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