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