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