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