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