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