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