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