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