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