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