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