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