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