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