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