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