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