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