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