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