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