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