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