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