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