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