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