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