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