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