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