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