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