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