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 friends = ["Zoya", "Riya", "Kabir"];
friends.pop();
show(friends[friends.length - 1]); (a) Zoya (b) Kabir (c) Riya - 2.Which of these fits saving on the phone? (a) chat messages to friends (b) a shared to-do list (c) a draft you are typing (d) photos on two devices
-
3.💾 What does this code show? (Positions start at 0.)
let songs = ["Stars", "Sunrise", "Monsoon"];
show(songs[0]); (a) Sunrise (b) Stars (c) Monsoon - 4.💾 Where should the app save the sound on/off setting: on the phone or in the cloud? (a) on the phone (b) in the cloud
- 5.True or false: chat messages to friends fits saving on the phone. (a) True (b) False
- 6.True or false: chat messages to friends fits saving in the cloud. (a) True (b) False
- 7.💾 Where should the app save a class leaderboard: on the phone or in the cloud? (a) on the phone (b) in the cloud
- 8.💾 Saving data in the cloud lets you ___. (a) shrink the app (b) never need a password (c) use it on any device (d) skip the internet
-
9.💾 What number does this code show?
let friends = ["Aman", "Zoya", "Meera"];
friends.push("Kabir");
friends.push("Riya");
show(friends.length); -
10.💾 What number does this code show?
let notes = ["Sports", "Hindi", "Music"];
notes.push("Maths");
notes.push("Science");
show(notes.length); - 11.💾 Which can hold many values in order? (a) a single number (b) a list (c) a switch (d) a button
- 12.💾 Where should the app save your last game level: on the phone or in the cloud? (a) on the phone (b) in the cloud
- 13.💾 Where should the app save photos on two devices: on the phone or in the cloud? (a) in the cloud (b) on the phone
-
14.💾 What number does this code show?
let score = 3;
score = score - 1;
score = score + 4;
show(score); -
15.💾 What number does this code show?
let notes = ["Science", "Art", "Music", "Sports"];
notes.push("Hindi");
show(notes.length); -
16.💾 What does this code show? (Positions start at 0.)
let songs = ["Stars", "Kites", "Sunrise"];
show(songs[2]); (a) Kites (b) Sunrise (c) Stars - 17.💾 Where should the app save notes to read offline: on the phone or in the cloud? (a) on the phone (b) in the cloud
-
18.💾 What number does this code show?
let notes = ["Hindi", "Art", "Maths"];
notes.push("Music");
notes.push("Science");
show(notes.length); - 19.True or false: the sound on/off setting fits saving on the phone. (a) False (b) True
- 20.True or false: a class leaderboard fits saving in the cloud. (a) True (b) False
-
21.💾 What number does this code show?
let songs = ["Kites", "Monsoon"];
songs.push("Rain");
songs.push("Stars");
show(songs.length); -
22.💾 What does this code show? (Positions start at 0.)
let notes = ["Art", "Music", "Hindi"];
show(notes[2]); (a) Music (b) Art (c) Hindi - 23.Which of these fits saving on the phone? (a) a class leaderboard (b) the sound on/off setting (c) a shared to-do list (d) chat messages to friends
- 24.True or false: a draft you are typing fits saving on the phone. (a) True (b) False
-
25.💾 What number does this code show?
let stars = 7;
stars = stars - 1;
stars = stars + 5;
show(stars); - 26.Which of these fits saving in the cloud? (a) your last game level (b) a draft you are typing (c) notes to read offline (d) a shared to-do list
-
27.💾 pop() takes off the last item. What does this code show?
let songs = ["Sunrise", "Kites", "Monsoon"];
songs.pop();
show(songs[songs.length - 1]); (a) Sunrise (b) Monsoon (c) Kites -
28.💾 What does this code show? (Positions start at 0.)
let notes = ["Art", "Sports", "Hindi", "Science"];
show(notes[0]); (a) Hindi (b) Sports (c) Science (d) Art -
29.💾 What number does this code show?
let notes = ["Music", "Science", "Maths", "Art"];
notes.push("Hindi");
notes.push("Sports");
show(notes.length); -
30.💾 What does this code show? (Positions start at 0.)
let friends = ["Aman", "Meera", "Zoya"];
show(friends[2]); (a) Zoya (b) Aman (c) Meera -
31.💾 What number does this code show?
let songs = ["Ocean", "Stars"];
songs.push("Rain");
show(songs.length); -
32.💾 pop() takes off the last item. What does this code show?
let songs = ["Ocean", "Stars", "Rain"];
songs.pop();
show(songs[songs.length - 1]); (a) Ocean (b) Stars (c) Rain - 33.💾 Which works with no internet at all? (a) a cloud leaderboard (b) data saved on the phone (c) a shared chat (d) a cloud backup
- 34.💾 Where should the app save a shared to-do list: on the phone or in the cloud? (a) in the cloud (b) on the phone
-
35.💾 What number does this code show?
let notes = ["Maths", "Art", "Sports"];
notes.push("Music");
notes.push("Hindi");
show(notes.length); -
36.💾 pop() takes off the last item. What does this code show?
let songs = ["Rain", "Sunrise", "Kites", "Ocean", "Stars"];
songs.pop();
show(songs[songs.length - 1]); (a) Ocean (b) Sunrise (c) Kites (d) Rain - 37.True or false: a draft you are typing fits saving in the cloud. (a) True (b) False
-
38.💾 What number does this code show?
let coins = 4;
coins = coins - 1;
coins = coins + 3;
show(coins); - 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.Which of these fits saving on the phone? (a) a shared to-do list (b) your last game level (c) chat messages to friends (d) a class leaderboard
Answer key
- Riya
- a draft you are typing
- Stars
- on the phone
- False
- True
- in the cloud
- use it on any device
- 5
- 5
- a list
- on the phone
- in the cloud
- 6
- 5
- Sunrise
- on the phone
- 5
- True
- True
- 4
- Hindi
- the sound on/off setting
- True
- 11
- a shared to-do list
- Kites
- Art
- 6
- Zoya
- 3
- Stars
- data saved on the phone
- in the cloud
- 5
- Ocean
- False
- 6
- in the cloud
- your last game level
Free app development lessons, practice and worksheets at talentjr.in/app-development-for-students