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