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