These eight original questions cover the skills in web and project development. Attempt each one on paper before opening the answer.
Questions
Question 1
Sort each item into structure, presentation or behaviour: (a) a paragraph reading “Welcome”, (b) the paragraph is italic, (c) the paragraph disappears when a button is clicked.
Answer
(a) Structure, because it is content in HTML. (b) Presentation, because italic is appearance and belongs in CSS. (c) Behaviour, because it is a reaction to a click and belongs in JavaScript.
For the lesson behind this, see separating structure, presentation and behaviour.
Question 2
A page sets the colour separately inside every heading tag. Give one problem this causes when the colour must change.
Answer
Every heading tag must be edited one by one, and one missed heading leaves the page inconsistent. A single CSS rule for headings would change all of them in one place.
Question 3
A requirement reads “The page should be user friendly”. Rewrite it so it can be tested.
Answer
One rewrite: “When the name box is empty and the user presses Submit, the page shows the message ‘Please enter your name’.” It names an input, an action and an expected result, so a test can pass or fail.
Question 4
A project has six features but only four weeks. Two features are the core of the project. What should the plan do with the other four?
Answer
Mark the two core features as must have and schedule them first, with testing. Mark the other four as nice to have and attempt them only if time remains. Record any dropped feature and the reason in the work log.
Question 5
A field accepts a whole number of pets from 0 to 10. List one normal, two boundary, one invalid and one empty test, with expected results.
Answer
- 4: normal, accepted.
- 0 and 10: boundary, both accepted. (11 or −1 would be outside, rejected.)
- “cat”: invalid, rejected with a message.
- blank: empty, rejected with a message.
The lesson testing interaction and data validation explains each kind.
Question 6
A test table shows: input 10, expected “Accepted”, actual “Rejected”. The code says if (n < 10). Explain the fault and the fix.
Answer
The condition excludes 10 because 10 is not less than 10. Since 10 is a valid value, change the condition to n <= 10. Then re-run the whole test set, including 0, 11 and a blank input.
Question 7
Rewrite this work log entry so it is specific: “Fixed the thing. Got some help.”
Answer
A good rewrite: “8 March. The total showed 0 because I set it to 0 inside the loop.
I moved that line above the loop and the total is now correct. My teacher explained how variables behave in a loop; I made the change myself.”
It has a cause, a change, the result and who did what. See documenting your own work on an assessed project.
Question 8
A friend offers to write your assessed project’s main function so you can “save time”. Give two reasons to decline and one way to ask for help instead.
Answer
Reasons: the submission must be your own work, and you would be unable to explain code you did not write. You could also lose the practice that the assessment is meant to build.
Instead, ask the friend to explain the idea behind the function using a different example, then write your version yourself and record the help in your log.
If you got these wrong
- Questions 1 and 2: revise separating structure, presentation and behaviour.
- Questions 3 and 4: revise planning an original assessed project.
- Questions 5 and 6: revise testing interaction and data validation.
- Questions 7 and 8: revise the documentation lesson linked under question 7.
To review your answers with a teacher, see online one-to-one Computer Science tuition.