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