Computer Science (AS & A Level) · May / June 2024 · Paper 22 · Question 4
9618
As printed in the paper
The question as text
A triangle has sides of length A, B and C. C A B 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 × A = (B × B) + (C × 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. 9 Write pseudocode for the procedure IsRA(). [5]
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

