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