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