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