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