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