Skip to content
SPM Tuition
Web and project development practice

Web and project development: practice with answers

You have read the lessons and now want to see whether you can do the questions unaided.

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

To review your answers with a teacher, see online one-to-one Computer Science tuition.

Common questions

How should I use this practice set?

Cover the answers, write your own response on paper, then open the answer. Mark yourself honestly. If you got a question wrong, read the linked lesson and try a similar question a day later.

Are these questions from the real SPM paper?

No. They are original questions written for practice. They follow the skills in this cluster but are not copied from any paper, so use them to check understanding, not to predict an exam.

Should I time myself?

Do the first pass untimed to learn the method. On a later pass, time yourself on a few questions to build pace. The timed practice session builder can help you set this up.

If the same question types keep going wrong, one-to-one Computer Science lessons let a teacher look at your written answers and find the habit behind the errors.

  • Online one-to-one lessons for your child with an experienced teacher.
  • Your first class is a one-hour trial, from RM50. The fee is agreed before you book.
  • Happy with the teacher? Continue with lessons of about 1.5 hours. If not, ask for another teacher.