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