Assignment E (extra credit)

Due March 4 at midnight
Cutoff March 4 at midnight

Write a program that combines program 2 and 3. I.e. it will read a sequence of integers one per line with a final value of zero. It will then print the largest positive value and the largest negative value.. Note that it may be possible that no negative value will be in the list (or no positive value). If this is the case then the answer should contain a statement to that effect.

For example if the data consists of
-3
-17
2
-35
9
0

then the output should be

The largest positive value is 9.

The largest negative value is -17.

 

If the data consisted of

-2
-5
0

then the output should be

There were no positive values.

The largest negative value is -2.