Change the function of Exercise 8 so that it also outputs the greatest number thus far, as it outputs the numbers in reverse order. For example, the I/O dialog might be the following:
Enter positive number, 0 to end: 10Greatest: 10Enter positive number, 0 to end: 30Greatest: 30Enter positive number, 0 to end: 20Greatest: 30Enter positive number, 0 to end: 0
The function then outputs
20 Greatest: 2030 Greatest: 3010 Greatest: 30The greatest is 30
Exercise 8
Change the function of Exercise 7 so that it outputs the greatest number entered thus far, as the user is entering the data. For example, the I/O dialog might be the following:
Enter positive number, 0 to end: 10Greatest: 10Enter positive number, 0 to end: 30Greatest: 30Enter positive number, 0 to end: 20Greatest: 30Enter positive number, 0 to end: 0
The function then outputs
20
30
10
The greatest is 30
Exercise 7
Extend the function of Exercise 4 so that it reports the greatest value entered, at the end of its output. For example, the I/O dialog might be the following:
Enter positive number, 0 to end: 10Enter positive number, 0 to end: 20Enter positive number, 0 to end: 30Enter positive number, 0 to end: 0
The function then outputs
30
20
10
The greatest is 30
Exercise 4
Write a recursive function that asks the user to enter a positive integer number each time it is called, until zero or a negative number is input. The function then outputs the numbers entered in reverse order. For example, the I/O dialog might be the following:
Enter positive number, 0 to end: 10Enter positive number, 0 to end: 20Enter positive number, 0 to end: 30Enter positive number, 0 to end: 0
The function then outputs
30
20
10
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.