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