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