Photo AI

Complete the table to give the output when each of the following set of values are input into the algorithm as X and Y - OCR - GCSE Computer Science - Question 2 - 2019 - Paper 1

Question icon

Question 2

Complete-the-table-to-give-the-output-when-each-of-the-following-set-of-values-are-input-into-the-algorithm-as-X-and-Y-OCR-GCSE Computer Science-Question 2-2019-Paper 1.png

Complete the table to give the output when each of the following set of values are input into the algorithm as X and Y. Input value of X Input value of Y Output 15 ... show full transcript

Worked Solution & Example Answer:Complete the table to give the output when each of the following set of values are input into the algorithm as X and Y - OCR - GCSE Computer Science - Question 2 - 2019 - Paper 1

Step 1

Input value of X = 15; Input value of Y = 10

96%

114 rated

Answer

Since 15 > 10 is TRUE, we check the next condition. 15 < 12 is FALSE, thus we output Y * X= 10 * 15 = 150.

Step 2

Input value of X = 6; Input value of Y = 5

99%

104 rated

Answer

Since 6 > 5 is TRUE, we check the next condition. 6 < 12 is TRUE, so we output X = 6.

Step 3

Input value of X = 2; Input value of Y = 3

96%

101 rated

Answer

Since 2 > 3 is FALSE, we check the next condition. 2 < 12 is TRUE, thus we output X = 2.

Step 4

Input value of X = 12; Input value of Y = 2

98%

120 rated

Answer

Since 12 > 2 is TRUE, we check the next condition. 12 < 12 is FALSE, so we output Y * X = 2 * 12 = 24.

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;