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