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