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