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