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