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