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