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