Question: 1) Write a program named first that reads from standard input an arbitrary number of integers (terminated with an EOF character) and writes to standard
1) Write a program named first that reads from standard input an arbitrary number of integers (terminated with an EOF character) and writes to standard out the largest integer read.
2) As above, but this time write a program named third that reads from standard input an arbitrary number of integers (ended with an EOF character) and writes to standard out the third largest integer read
3) Implement the Babylonian algorithm, as seen in the lectures, in Java:
A. Write a program that takes as input a single integer, and outputs its square-root to the nearest integer, rounded down.
B. Write a program that takes as input a floating point number, and outputs its square-root to the nearest integer, rounded down.
C. Write a program that reads from from standard input two floating point numbers. It then outputs the square-root of the first number to within an accuracy set by the second number. For example, if the input is: 97 0.00001 Then your program should could output: 9.848857 Note: accuracy means to within a distance of. In other words an accuracy of 0.01 means that the answer provided, and the correct answer are guaranteed to be no further apart than 0.01. In the example above, your program could also, just as correctly, give any other answer that is within 0.00001 of the correct answer.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
