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