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