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