subject

In Java PLease In this program we are going to practice using the Math class by computing some important values on the unit circle. Using the angles 0, PI/2, and PI, print out the angle, the cosine of the angle, and the sine of the angle.

Your output should look like this:

Radians: (cos, sin)
0.0: 1.0, 0.0
1.5707963267948966: 0.0, 1.0
3.141592653589793: -1.0, 0.0
Hints:

You’ll need to use the Math. sin, Math. cos methods
and the Math. PI constant!
You can round a decimal to 2 decimal places by multiplying by 100, rounding to the nearest int using Math. round, and then dividing by 100. You will need to round the sine and cosine values. Here’s an example:
double angle = Math. PI/4;
double cosine = Math. cos(angle); // 0.707106781
cosine = cosine * 100; // 70.7106781
cosine = Math. round(cosine); // 71.0
cosine = cosine / 100.0; // 0.71

// Or put it all on one line:
cosine = Math. round(cosine * 100) / 100.0;

Some Math Background
The Java methods need the angles to be in radians, rather than degrees. PI/2 radians is equal to 90 degrees. PI radians is equal to 180 degrees.
That’s why we’re using multiples of PI in this exercise.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:30
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
question
Computers and Technology, 25.06.2019 06:50
A1-megabit computer memory chip contains many 27 ff capacitors. each capacitor has a plate area of 3.09 × 10−11 m 2 . determine the plate separation of such a capacitor (assume an empty parallel-plate configuration). the characteristic atomic diameter is 10−10 m = 1 ˚a, and the permittivity of a vacuum is 8.8542 × 10−12 c 2 /n · m2 . answer in units of ˚a.
Answers: 3
question
Computers and Technology, 25.06.2019 08:00
In researching his history report about the civil war, why is ariq most likely to use secondary data than primary data? secondary data provides a starting point to find primary data. secondary data is easier and less time consuming to find. secondary data is always more reliable and credible. secondary data eliminates the need for other research.
Answers: 1
You know the right answer?
In Java PLease In this program we are going to practice using the Math class by computing some impo...
Questions
question
Mathematics, 29.10.2020 21:10
question
Mathematics, 29.10.2020 21:10
question
Social Studies, 29.10.2020 21:10
question
Mathematics, 29.10.2020 21:10
question
Mathematics, 29.10.2020 21:10
question
Social Studies, 29.10.2020 21:10
question
Mathematics, 29.10.2020 21:10
Questions on the website: 13722363