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