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