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