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