Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

Students also viewed these Databases questions