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