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