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