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