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