161k views
4 votes
The program below is run. Which of the following COULD NOT possibly be the output from that program?

a <- RANDOM(1,10)
b <- RANDOM(10,20)
DISPLAY(a)
DISPLAY(a)
DISPLAY(b)
DISPLAY(b)
A) 5, 5, 12, 12
B) 2, 2, 17, 17
C) 1, 1, 14, 14
D) 8, 8, 15, 15

User TomZ
by
7.0k points

1 Answer

6 votes

Final answer:

The program generates random numbers and displays their values. Option C) 1, 1, 14, 14 is not possible because it includes a value outside the range of 1 to 10 for variable a.

Step-by-step explanation:

The program below uses the RANDOM function to generate random numbers. It then displays the values of variables a and b twice each:

a <- RANDOM(1,10)
b <- RANDOM(10,20)
DISPLAY(a)
DISPLAY(a)
DISPLAY(b)
DISPLAY(b)

To determine which output is not possible, we need to consider the possible range of values for a and b. The range for a is 1 to 10, and the range for b is 10 to 20. From the given options, option C) 1, 1, 14, 14 is not possible because it includes the value 14 for a, which is outside the range of 1 to 10.

User Ddreian
by
7.4k points