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