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