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