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