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