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