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