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