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