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