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