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