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