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