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