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