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