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