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