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