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