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