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