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