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