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