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