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