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