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