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