Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions