Question
This must be a Java program that: Correctly compiles under the UNIX command line. When run, reads a a double-precision floating-point number (type double) number
This must be a Java program that:
Correctly compiles under the UNIX command line.
When run, reads a a double-precision floating-point number (type double) number and outputs its square root, to the nearest integer rounded down, as an integer (no decimal places) to standard output.
HINT: In order to print your output as an integer, without any decimal places, you may make use of the Java method printf. Heres an example of how you would correctly use this method in your program: System.out.println((int) output);
If you wish, you may also use the methods Math.abs() and Math.floor()
You may NOT, however use the method Math.sqrt(). Doing so will immediately give you a zero for this assignment. You are meant to implement the algorithm seen in class by hand.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started