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