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