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