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