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