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