Exploring the Math Class
Exploring the Math Class
Coding Project
Display a randomly generated integer between -20 and 20 and then display the absolute value of that
number.
Randomly generate an angle measure (as an integer) between 0 and 90 and display the three
trigonometric identities (sine, cosine, and tangent) of those angles.
Ask the user to enter in three integers a, b, and c for a quadratic equation 𝑎𝑥 2 + 𝑏𝑥 + 𝑐 = 0 and report
both solutions. Assume the user will enter in three non-zero integers that will not result in an imaginary
solution.
Ask the user to enter in the radius of a circle (as a decimal) and print off the circumference and area of
that circle. Use Math.PI to represent π in your equation.
Randomly generate a decimal between 0 and 9 and round it three different ways:
o Using printf("%.0f", number)
o Using Math.round(number)
o Using (int)(number + 0.5)
Sample Run:
First Random Number: -8
Absolute Value: 8
Enter in a: 2
Enter in b: 10
Enter in c: 5
The first solution is: -0.5635083268962915
The second solution is: -4.436491673103708
6
6
6