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