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