Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 11:00, shawn20034
This chapter lists many ways in which becoming computer literate is beneficial. think about what your life will be like once you’re started in your career. what areas of computing will be most important for you to understand? how would an understanding of computer hardware and software you in working from home, working with groups in other countries and contributing your talents.
Answers: 1
image
Computers and Technology, 23.06.2019 15:30, jokerr6323
1. ask the user how many questions are in the quiz. 2. ask the user to enter the key (that is, the correct answers). there should be one answer for each question in the quiz, and each answer should be an integer. e. g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. you will need to store the key in an array. 3. ask the user to enter the answers for the quiz to be graded. there needs to be one answer for each question. note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. when the user has entered all of the answers to be graded, print the number correct and the percent correct. 5. add a loop so that the user can grade any number of quizzes with a single key. after the results have been printed for each quiz, ask "grade another quiz? (y/n)." note: you only have one array (the key). you are not creating a new key for each set of quiz answers.
Answers: 3
image
Computers and Technology, 24.06.2019 00:00, marika35
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
image
Computers and Technology, 24.06.2019 04:30, shadenShaden2037
What is the process in which the software development team compiles information to determine the final product
Answers: 1
Do you know the correct answer?
In Java PLease In this program we are going to practice using the Math class by computing some impo...

Questions in other subjects:

Konu
History, 03.01.2022 08:10
Konu
Mathematics, 03.01.2022 08:10
Konu
Mathematics, 03.01.2022 08:10