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