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