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