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