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