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