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