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