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