Skip to main content
A-LevelComputer ScienceProgramming9618/22 · May/June 2024 · Q45 Marks

A triangle has sides of length A, B and C. [Figure of a triangle with sides A, B, C] In this example, A is the length of the longest side. This triangle is said to be right-angled if the following equation is true: A x A = (B x B) + (C x C) A procedure will be written to check whether three lengths represent a right-angled triangle. The lengths will be input in any sequence. The procedure IsRA () will: • prompt and input three integer values representing the three lengths • test whether the three lengths correspond to the sides of a right-angled triangle • output a suitable message. The length of the longest side may not be the first value input.

  1. Write pseudocode for the procedure IsRA().[5]

This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.

Mark scheme

Marking points from the official mark scheme (May/June 2024). The mark or mark type is shown in brackets.

  1. [5] Mark as follows:
  2. 1. Procedure heading and ending and declaration of all variables used
  3. 2. Appropriate prompt and input for each length
  4. 3. One correct length test
  5. 4. All three length tests // selection of which test is required
  6. 5. Output one of two messages following a reasonable attempt at MP3

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Programming, A-Level Computer Science (syllabus 9618). Structured question, 5 marks.
Source
A-Level Computer Science, May/June 2024 Paper 2 Variant 2, question 4.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep