Question: Math.floor can be used to round values to the nearest integere.g., double y = Math.floor(x + 0.5); will round the number x to the nearest
Math.floor can be used to round values to the nearest integer—e.g.,
double y = Math.floor(x + 0.5);
will round the number x to the nearest integer and assign the result to y. Write an application that reads double values and uses the preceding statement to round each of the numbers to the nearest integer. For each number processed, display both the original number and the rounded number.
Step by Step Solution
3.28 Rating (163 Votes )
There are 3 Steps involved in it
The task you have requested is a Java application that reads in double values rounds them to the nea... View full answer
Get step-by-step solutions from verified subject matter experts
