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