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