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