App Dev Worksheet: Final Test
Developer's tip (Plan, design, build, check): Find the topic: what apps are, designing apps, or logic and building. Read every screen, list or code line carefully, top to bottom. For code, write each value down step by step and check it again.
NameDateTime takenScore ___ / 40
-
1.🐞 Each comment says what its line SHOULD do. Which line has the bug?
line 1: let lives = 42; // start at 42
line 2: lives = lives + 2; // add 2
line 3: lives = lives - 3; // take away 3
line 4: lives = lives + 2; // double it
line 5: show(lives); // show it (a) line 4 (b) line 3 (c) line 2 (d) line 1 -
2.🐞 Each comment says what its line SHOULD do. Which line has the bug?
line 1: let score = 40; // start at 40
line 2: score = score - 3; // take away 3
line 3: score = score + 5; // add 5
line 4: score = score + 2; // double it
line 5: show(score); // show it (a) line 4 (b) line 1 (c) line 2 (d) line 3 - 3.💡 Does an app idea like a lost-and-found board solve a real problem? (a) No (b) Yes
- 4.True or false: space between buttons is good button design. (a) False (b) True
- 5.🧭 Which part of navigation undoes one move? (a) the back button (b) a menu button (c) a tab bar
- 6.🧩 In an app, what is tap to Send? (a) a button (b) an input (c) a screen (d) data
-
7.🐞 This code has a bug. What number does it ACTUALLY show?
line 1: let score = 32; // start at 32
line 2: score = score + 8; // add 5
line 3: score = score - 3; // take away 3
line 4: score = score + 5; // add 5
line 5: show(score); // show it -
8.🔁 What number does this code show?
let steps = [42, 90, 23, 80];
let count = 0;
for (let i = 0; i < steps.length; i++) {
if (steps[i] >= 60) {
count = count + 1;
}
}
show(count); - 9.True or false: a step counter is a game. (a) True (b) False
-
10.🧪 What is the ACTUAL result of Test 3?
🎟️ Rule: a ticket costs 50 for children under 8, and 100 for everyone else.
function price(age) {
if (age <= 8) {
return 50;
}
return 100;
}
Test 1: price(12) → expected 100
Test 2: price(14) → expected 100
Test 3: price(4) → expected 50 -
11.🔁 What number does this code show?
let runs = [16, 20, 9];
let total = 0;
for (let i = 0; i < runs.length; i++) {
total = total + runs[i];
}
show(total); - 12.✏️ Why draw a wireframe before coding? (a) it runs the app (b) it saves data (c) it adds colours (d) changes are quick
- 13.🧪 What is the actual result of a test? (a) the app’s name (b) what the app really does (c) the test’s number (d) what we hope for
-
14.⚙️ What number does this app show?
let price = 85; // typed by the user
let qty = 5; // typed by the user
let total = price * qty;
show(total); - 15.True or false: you spot a problem to solve at the plan stage. (a) False (b) True
- 16.👆 What kind of event is this: the screen first opens? (a) a text event (b) a load event (c) a timer event (d) a tap event
-
17.👆 The user taps the button 3 times. What number does the label show now?
let likes = 0;
button.onTap = function () {
if (likes < 5) {
likes = likes + 1;
}
label.text = likes;
}; - 18.True or false: the screen first opens is a tap event. (a) True (b) False
- 19.True or false: the font size is about UI (the look). (a) False (b) True
-
20.⚙️ Which line does the processing (works out the answer)?
line 1: let bill = 235; // typed by the user
line 2: let friends = 5; // typed by the user
line 3: let share = bill / friends;
line 4: show(share); (a) line 4 (b) line 2 (c) line 1 (d) line 3 - 21.🔁 What does a loop do? (a) deletes code (b) repeats code (c) saves photos (d) draws icons
-
22.🧰 What number does this code show?
function total(price, qty) {
return price * qty;
}
show(total(10, 6)); - 23.🚀 Your app is at version 2.11.1. The next release fixes a small bug. What is its version number? (a) 3.0.0 (b) 2.11.2 (c) 2.12.1 (d) 2.12.0
- 24.Which of these is true of a website? (a) needs no installing (b) comes from an app store (c) has a home-screen icon (d) is installed on a phone
- 25.🔍 Which is the odd one out? (a) the button colours (b) how fast a task is done (c) whether users get lost (d) how easy sign-up is
-
26.💾 What number does this code show?
let lives = 4;
lives = lives - 1;
lives = lives + 5;
show(lives); - 27.⚙️ In an app, is tapping a button an input, processing or an output? (a) processing (b) input (c) output
- 28.True or false: a website has a home-screen icon. (a) True (b) False
- 29.Which of these is a screen? (a) a slider for volume (b) your saved notes (c) tap to go Next (d) the settings page
-
30.🔁 What number does this code show?
let steps = [2, 20, 2, 1];
let total = 0;
for (let i = 0; i < steps.length; i++) {
total = total + steps[i];
}
show(total); -
31.🔀 What does this PIN rule show?
let pin = "7960";
if (pin.length === 4) {
show("PIN saved");
} else {
show("Use 4 digits");
} (a) Use 4 digits (b) PIN saved -
32.🧪 What is the ACTUAL result of Test 2?
🚚 Rule: delivery is free (0) when the order is 500 or more; otherwise it costs 40.
function delivery(total) {
if (total > 500) {
return 0;
}
return 40;
}
Test 1: delivery(300) → expected 40
Test 2: delivery(650) → expected 0
Test 3: delivery(500) → expected 0 - 33.True or false: a puzzle with levels is a tool app. (a) False (b) True
-
34.💾 What number does this code show?
let songs = ["Kites", "Rain"];
songs.push("Monsoon");
songs.push("Stars");
show(songs.length); - 35.🔢 In a food-order flow, which comes first: “track the order” or “pay for the order”? (a) track the order (b) pay for the order
-
36.🐞 Each comment says what its line SHOULD do. Which line has the bug?
line 1: let stars = 40; // start at 37
line 2: stars = stars * 2; // double it
line 3: stars = stars * 2; // double it
line 4: show(stars); // show it (a) line 1 (b) line 2 (c) line 3 - 37.True or false: the app starts up is a tap event. (a) True (b) False
-
38.🐞 This code has a bug. What number SHOULD it show, if every line did what its comment says?
line 1: let stars = 35; // start at 33
line 2: stars = stars - 5; // take away 5
line 3: stars = stars * 2; // double it
line 4: show(stars); // show it - 39.💡 Does an app idea like a library due-date alert solve a real problem? (a) No (b) Yes
-
40.⚙️ Which line does the processing (works out the answer)?
line 1: let bill = 120; // typed by the user
line 2: let friends = 2; // typed by the user
line 3: let share = bill / friends;
line 4: show(share); (a) line 4 (b) line 2 (c) line 3 (d) line 1
Answer key
- line 4
- line 4
- Yes
- True
- the back button
- a button
- 42
- 2
- False
- 50
- 45
- changes are quick
- what the app really does
- 425
- False
- a load event
- 3
- False
- True
- line 3
- repeats code
- 60
- 2.11.2
- needs no installing
- the button colours
- 8
- input
- False
- the settings page
- 25
- PIN saved
- 0
- False
- 4
- pay for the order
- line 1
- False
- 56
- Yes
- line 3
Free app development lessons, practice and worksheets at talentjr.in/app-development-for-students