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