Answer:
Step-by-step explanation:
The following code is written in Java and performs every action requested in the question. Instead of converting back and forth it saves the decimal/double value in one variable and the integer value in another variable so both can easily be accessed and printed.
import java.util.Scanner;
public class DecimalFloor {
public static void main(String args[]) {
//Ask for input and place into variable decimalValue
Scanner in = new Scanner(System.in);
System.out.println("Input decimal value:");
double decimalValue = in.nextDouble();
//Rounding down decimalValue to integer
int integerValue = (int) Math.floor(decimalValue);
//Print both integerValue and decimalValue
System.out.println(integerValue);
System.out.println(decimalValue);
}
}