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