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