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