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