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