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