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