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