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