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