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