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