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