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