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