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