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