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