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