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