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