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, 22.06.2019 08:10
Alook-up table used to convert pixel values to output values on a monitor. essentially, all pixels with a value of 190 or above are shown as white (i.e. 255), and all values with a value of 63 or less are shown as black (i.e. 0). in between the pixels are scaled so that a pixel with a value p is converted to a pixel of value 2/127 −+3969). if a pixel has a value of 170 originally, what value will be used to display the pixel on the monitor? if a value of 110 is used to display the pixel on the monitor, what was the original value of the pixel?
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
How do i get rid of my member ship for
Answers: 2
question
Computers and Technology, 24.06.2019 07:40
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
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
question
Physics, 04.12.2020 06:20
question
Social Studies, 04.12.2020 06:20
question
Mathematics, 04.12.2020 06:20
question
Physics, 04.12.2020 06:20
question
Arts, 04.12.2020 06:20
question
Chemistry, 04.12.2020 06:20
Questions on the website: 13722362