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