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