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