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