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