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