How would you modify the final design of code below to find the minimum value?


LET count = 0
INPUT num
LET max = num
DO UNTIL num = 9999
IF num > max THEN LET max = num
LET count = count + 1
INPUT num
LOOP
IF count > 0 THEN
OUTPUT "The maximum value in the data list is ", max
ELSE
OUTPUT "The data list is empty."
END IF



LET count = 0
INPUT num
LET min = num
DO UNTIL num = 9999
IF num < min THEN LET min = num
LET count = count + 1
INPUT num
LOOP
IF count > 0 THEN
OUTPUT "The minimum value in the data list is ", min
ELSE
OUTPUT "The data list is empty."
END IF

Computer Science & Information Technology

You might also like to view...

When more than one class is derived from a base class, the situation is called

A) polymorphism. B) population. C) multiplicity. D) encapsulation. E) None of the above

Computer Science & Information Technology

What is object-oriented programming?

What will be an ideal response?

Computer Science & Information Technology

Analyze the following recursive method.

``` public static long factorial(int n) { return n * factorial(n - 1); } ``` a. Invoking factorial(0) returns 0. b. Invoking factorial(1) returns 1. c. Invoking factorial(2) returns 2. d. Invoking factorial(3) returns 6. e. The method runs infinitely and causes a StackOverflowError.

Computer Science & Information Technology

SPIKE can fuzz any protocol that utilizes ____.

A. TCP/IP B. FTP C. SNMP D. Telnet

Computer Science & Information Technology