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