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