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