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