Question: Write a method that will take in a double value and round it down to the nearest whole number and return it as an integer.

Write a method that will take in a double value and round it down to the nearest whole number and return it as an integer. Here is a stub to get you started:

public class Problem24 { public static void main(String[] args) { System.out.println(roundDown(1.9)); // 1 System.out.println(roundDown(3.2)); // 3 System.out.println(roundDown(3.0)); // 3 System.out.println(roundDown(17.9999)); // 17 } public static int roundDown(double number) { // Your code here } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!