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