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