App Dev Worksheet: Variables, Lists and Saving
Developer's tip (Box, list, place): A variable holds one value; a list holds many in order. Positions start at 0. push adds to the end; pop takes off the last item; length is how many items. On the phone: works offline, private. In the cloud: shared, any device, needs the internet.
NameDateTime takenScore ___ / 40
-
1.💾 pop() takes off the last item. What does this code show?
let songs = ["Sunrise", "Rain", "Stars", "Ocean"];
songs.pop();
show(songs[songs.length - 1]); (a) Ocean (b) Sunrise (c) Rain (d) Stars - 2.💾 Saving data in the cloud lets you ___. (a) use it on any device (b) never need a password (c) skip the internet (d) shrink the app
- 3.Which of these fits saving in the cloud? (a) the sound on/off setting (b) a shared to-do list (c) notes to read offline (d) a draft you are typing
-
4.💾 What number does this code show?
let friends = ["Aman", "Zoya", "Riya", "Kabir"];
friends.push("Arjun");
show(friends.length); - 5.💾 What is a variable? (a) a named box for a value (b) a phone setting (c) a picture (d) a type of screen
- 6.💾 Where should the app save a draft you are typing: on the phone or in the cloud? (a) on the phone (b) in the cloud
- 7.💾 Which can hold many values in order? (a) a single number (b) a list (c) a button (d) a switch
- 8.True or false: notes to read offline fits saving on the phone. (a) True (b) False
-
9.💾 What number does this code show?
let coins = 3;
coins = coins - 2;
coins = coins + 4;
show(coins); -
10.💾 What does this code show? (Positions start at 0.)
let friends = ["Meera", "Arjun", "Kabir"];
show(friends[2]); (a) Arjun (b) Kabir (c) Meera -
11.💾 What does this code show? (Positions start at 0.)
let friends = ["Arjun", "Aman", "Kabir", "Meera"];
show(friends[0]); (a) Meera (b) Kabir (c) Aman (d) Arjun - 12.True or false: a class leaderboard fits saving in the cloud. (a) False (b) True
- 13.Which of these fits saving on the phone? (a) a class leaderboard (b) chat messages to friends (c) a shared to-do list (d) your last game level
- 14.True or false: notes to read offline fits saving in the cloud. (a) False (b) True
-
15.💾 What number does this code show?
let friends = ["Aman", "Zoya"];
friends.push("Kabir");
show(friends.length); - 16.Which of these fits saving in the cloud? (a) photos on two devices (b) the sound on/off setting (c) notes to read offline (d) your last game level
-
17.💾 What number does this code show?
let friends = ["Arjun", "Zoya"];
friends.push("Aman");
show(friends.length); -
18.💾 What does this code show? (Positions start at 0.)
let songs = ["Stars", "Kites", "Rain", "Ocean"];
show(songs[3]); (a) Stars (b) Rain (c) Kites (d) Ocean - 19.💾 Where should the app save a class leaderboard: on the phone or in the cloud? (a) in the cloud (b) on the phone
-
20.💾 What number does this code show?
let stars = 3;
stars = stars - 1;
stars = stars + 3;
show(stars); -
21.💾 What does this code show? (Positions start at 0.)
let notes = ["Sports", "Hindi", "Art"];
show(notes[1]); (a) Sports (b) Hindi (c) Art -
22.💾 What number does this code show?
let songs = ["Rain", "Stars"];
songs.push("Sunrise");
songs.push("Kites");
show(songs.length); - 23.True or false: a class leaderboard fits saving on the phone. (a) True (b) False
-
24.💾 What number does this code show?
let friends = ["Aman", "Zoya"];
friends.push("Riya");
show(friends.length); - 25.True or false: a shared to-do list fits saving in the cloud. (a) True (b) False
- 26.True or false: chat messages to friends fits saving on the phone. (a) True (b) False
-
27.💾 pop() takes off the last item. What does this code show?
let notes = ["Maths", "Art", "Sports"];
notes.pop();
show(notes[notes.length - 1]); (a) Maths (b) Art (c) Sports - 28.💾 Data saved only on the phone is lost when ___. (a) the screen turns off (b) you send a message (c) the phone is lost (d) the app is closed
- 29.💾 Where should the app save a shared to-do list: on the phone or in the cloud? (a) on the phone (b) in the cloud
- 30.💾 Which works with no internet at all? (a) a cloud backup (b) data saved on the phone (c) a shared chat (d) a cloud leaderboard
- 31.💾 Where should the app save photos on two devices: on the phone or in the cloud? (a) in the cloud (b) on the phone
-
32.💾 What number does this code show?
let points = 3;
points = points - 2;
points = points + 1;
show(points); -
33.💾 What number does this code show?
let points = 6;
points = points - 2;
points = points + 5;
show(points); -
34.💾 What does this code show? (Positions start at 0.)
let notes = ["Sports", "Art", "Hindi", "Science", "Maths"];
show(notes[1]); (a) Art (b) Science (c) Sports (d) Hindi - 35.True or false: the sound on/off setting fits saving on the phone. (a) False (b) True
-
36.💾 What does this code show? (Positions start at 0.)
let songs = ["Monsoon", "Sunrise", "Kites"];
show(songs[0]); (a) Sunrise (b) Kites (c) Monsoon -
37.💾 pop() takes off the last item. What does this code show?
let songs = ["Sunrise", "Rain", "Stars", "Kites"];
songs.pop();
show(songs[songs.length - 1]); (a) Kites (b) Sunrise (c) Rain (d) Stars -
38.💾 What number does this code show?
let lives = 3;
lives = lives - 2;
lives = lives + 5;
show(lives); - 39.💾 Where should the app save chat messages to friends: on the phone or in the cloud? (a) in the cloud (b) on the phone
-
40.💾 What number does this code show?
let stars = 7;
stars = stars - 2;
stars = stars + 1;
show(stars);
Answer key
- Stars
- use it on any device
- a shared to-do list
- 5
- a named box for a value
- on the phone
- a list
- True
- 5
- Kabir
- Arjun
- True
- your last game level
- False
- 3
- photos on two devices
- 3
- Ocean
- in the cloud
- 5
- Hindi
- 4
- False
- 3
- True
- False
- Art
- the phone is lost
- in the cloud
- data saved on the phone
- in the cloud
- 2
- 9
- Art
- True
- Monsoon
- Stars
- 6
- in the cloud
- 6
Free app development lessons, practice and worksheets at talentjr.in/app-development-for-students