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