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