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