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