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