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