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