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