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