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