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