87.2k views
25 votes
The class name for the program should be 'Decimal Floor'. In the main method you should perform the following: Create a Scanner object. Input a decimal /double value using the Scanner object. Convert the input decimal/double value to an integer value (this will drop the decimal from the decimal/double value input). Output the decimal/double value input. Output the double/decimal value g

User Keelar
by
4.8k points

1 Answer

8 votes

Answer:

Answered below

Step-by-step explanation:

//Program is written in Java programming //language

Class Decimal floor{

public static void main (String args []){

Scanner dec = new Scanner(System.in);

System.out.print("Enter a decimal number: ");

double decimal = dec.nextline();

//Convert decimal to integer through casting

int wholeNumber = (int) decimal;

//Print out decimal number and whole number.

System.out.print(decimal);

System.out.println(wholeNumber);

}

}

User Hilary Park
by
4.8k points