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