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