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