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