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