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