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