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