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