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