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