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