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