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