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