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