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