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