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