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