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