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