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