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