Computers and Technology
Computers and Technology, 29.01.2021 08:00, maxB0846

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 17:20, gracie0818
Q-3 a technician is setting up a computer lab. computers on the same subnet need to communicate with eachother peer to peer communication, a. hardware firewallb. proxy serverc. software firewalld. gre tunneling
Answers: 3
image
Computers and Technology, 23.06.2019 22:20, andrew412603
Learning sign language is an example of a(n) learning sign language is an example of a(n)
Answers: 2
image
Computers and Technology, 24.06.2019 03:30, live4dramaoy0yf9
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
image
Computers and Technology, 24.06.2019 11:30, AnwarWeirdLol8811
Why is body language an important factor in a business meeting
Answers: 1
Do you know the correct answer?
Write a java program that prompts the user for the diameter of a circle and an x-increment "dx" (bot...

Questions in other subjects:

Konu
Mathematics, 13.10.2019 22:10
Konu
Mathematics, 13.10.2019 22:10