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