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