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