Question
Intro to Java Programming Class This assignment will focus on the use of arithematic operators. Casting will also be needed and will be described later
Intro to Java Programming Class
This assignment will focus on the use of arithematic operators. Casting will also be needed and will be described later in the assignment.
1. Create a Java program:
2. The class name for the program should be 'DecimalFloor'.
3. In the main method you should perform the following:
Create a Scanner object.
Input a decimal value using the Scanner object.
Round the input value down to the nearest integer (floor).
Output the value input.
Output the rounded value.
Pseudo flowchart for the assignment program:
1. Create a Scanner object using the Scanner class found in the java.util package.
2. Output a prompt asking the using to input a decimal value.
3. Accept the input value into a variable capable of holding decimal values.
4. Convert the decimal value to an integer value. This will drop all the decimal positions to the right of the decimal.
5. Covert the integer value to a double value.
6. Output the initial value input.
7. Output the rounded (floor) double value.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started