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