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