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