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