subject

Write a java program that prompts the user for the diameter of a circle and an x-increment "dx" (both in centimeters), then calculates and displays the area of the circle in square centimeters using a Riemann Sum. To find the area of the circle using a Riemann sum, first, find the area of one quadrant by dividing the quadrant into rectangles, each of width "dx" (as in "delta-x", which means "change in x"), and then use the Pythagorean Theorem to find the "y" value at each "x" value.

y = sqrt(r^2 - x^2)

Multiply "dx" by "y" to get the area of the rectangle at that "x" value (see attached diagram). Add the areas of the rectangles together, and you have the area of the quadrant. To obtain the area of the entire circle, multiply the quadrant's area by four.

The program should use a for loop to do the calculations.

All variables should be of type double.

It should also use at least 2 methods.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:00
State 7 common key's for every keyboard
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 24.06.2019 19:00
Which of the following "invisible" marks represents an inserted tab?
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
Aobject is used for displaying the results of a question based on stored data. a. query b. report c. table d. form
Answers: 2
You know the right answer?
Write a java program that prompts the user for the diameter of a circle and an x-increment "dx" (bot...
Questions
Questions on the website: 13722361