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