Question: Formatted Table : Write a program in C++ to print a small formatted table showing the radius, diameter, circumference, and area of two circles according

Formatted Table: Write a program in C++ to print a small formatted table showing the radius, diameter, circumference, and area of two circles according to the following specifications:

Prompt the user to enter the radius of two circles (in cm).

Display 3 tables. Each table should consist of the table number, the heading, and the values of radius, diameter, circumference, and area using the specified formatting.Table 1: Use the following formatting:

Use the table heading shown in the sample output

Left justification

Fixed format

3 digits after the decimal point

Show trailing zeros

Table 2: Use the following formatting:

Use the table heading shown in the sample output

Right justification

Fixed format

5 digits after the decimal point

Show trailing zeros

Table 3: Use the following formatting:

Use the table heading shown in the sample output

Left justification

Scientific format

2 digits after the decimal point

Show trailing zeros

Enter the radius for circle #1 (in cm): 2

Enter the radius for circle #2 (in cm): 5

Table #1:

Radius(cm) Diameter(cm) Circumference(cm) Area(cm^2)

2.000 4.000 12.566 12.566

5.000 10.000 31.416 78.540

Table #2:

Radius(cm) Diameter(cm) Circumference(cm) Area(cm^2)

2.00000 4.00000 12.56637 12.56637

5.00000 10.00000 31.41593 78.53982

Table #3:

Radius(cm) Diameter(cm) Circumference(cm) Area(cm^2)

2.00e+000 4.00e+000 1.26e+001 1.26e+001

5.00e+000 1.00e+001 3.14e+001 7.85e+001

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!