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