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