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