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