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: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Pl i need the answer now ! which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
Why is investing in a mutual fund less risky than investing in a particular company's stock? a. mutual funds only invest in blue-chip stocks. b. investments in mutual funds are more liquid. c. mutual funds hold a diversified portfolio of stocks. d. investments in mutual funds offer a higher rate of return.
Answers: 2
question
Computers and Technology, 24.06.2019 00:30
Asecurity policy is a a. set of guidlines b. set of transmission protocols c. written document d. set of rules based on standards and guidelines
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
Biology, 27.09.2021 14:00
question
Mathematics, 27.09.2021 14:00
question
Mathematics, 27.09.2021 14:00
question
Mathematics, 27.09.2021 14:00
question
Mathematics, 27.09.2021 14:00
Questions on the website: 13722362