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