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