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