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