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