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