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