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