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