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