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