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