Question
c++ The formula to compute the area of a circle is area = PI * radius 2 so if a circles radius doubles (i.e. is
c++
The formula to compute the area of a circle is
area = PI * radius2
so if a circles radius doubles (i.e. is multiplied by 2), the circles area will be four times as large as before. Write a program that creates a table showing the radius and area for a circle whose radius begins with 1 and continues doubling until it is 8. Use 3.14156 for PI or to be more accurate with your answers use PI = acos(-1). You may need to include
Use the following for your table heading (output once before the loop) if you like:
cout << " Circles " << "Radius Area " << "-------------- ";
and the following for the detail lines (one output per loop iteration):
cout << setw(4) << (your radius variable) << setw(9) << (computed area) << endl
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started