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.
- 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.
- [5] Mark as follows:
- 1. Procedure heading and ending and declaration of all variables used
- 2. Appropriate prompt and input for each length
- 3. One correct length test
- 4. All three length tests // selection of which test is required
- 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 →