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