Write a Java program the can do more complex math calculations.
- Casting variables
- Modulus and remainder
- Output with Strings and numbers
- Math library
Your program needs to
- Prompt the user to enter two integers, x and y.
- Calculate and print the following:
- The decimal equivalent of the fraction x / y.
- The quotient plus the remainder of the fraction x / y.
- The absolute value of x – y
- The exponential x raised to the y power.
- The square root of x times y.
- Make sure to test with numbers that will generate whole-number and decimal fractions (i.e. 4 /2 = 2.0 and 5 / 2 = 2.5), negative numbers, and zero as the denominator.
- Page 86-87 Conversion Techniques
- Cast one of the integers as a floating point number.
Edhesive Term 1
Lesson 6: Casting Variables
Lesson 7: Remainder and Modulus
Lesson 8: Output Strings and Numbers
Lesson 9: Import Math Class
Lesson 10: Roundoff Error