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