A sign company that creates roadway signs has enlisted your help to write a program to help them calculate how much vinyl they will need for their signs. Specifically, the company needs to know some information on signs in the shape of octagons, such as stop signs.
For this assignment, write a program that:
<cmath>
to perform this calculation.<cmath>
to perform this calculation.<cmath>
to perform this calculation.<iomanip>
library will need to be used to properly match the formatting.Area of an octagon:
Circumcircle radius of an octagon:
Incircle radius of an octagon:
Input/Output should be displayed in the following manner (matching the output exactly):
Enter octagon's side length: 10.5 +--------------+--------------+--------------+--------------+ | side length | area | circumcircle | incircle | +--------------+--------------+--------------+--------------+ | 10.50 | 532.33 | 13.72 | 12.68 | +--------------+--------------+--------------+--------------+
See CodeGrade for more examples.
Note: The line breaks after the inputs in the example output formatting above are the default ones C++’s cin
and getline()
automatically apply after reading an input from the user. CodeGrade supplies input in a different manner (Linux redirection) to programs so in CodeGrade's auto tests there will not be line breaks after the inputs.
As with every assignment your output must match CodeGrade perfectly. Below are some tips to help match the formatting:
+--------------+--------------+--------------+--------------+
"| "
, " | "
, or " |"
. (The |
is a pipe, not a lowercase l
or capital I
).12
.Save: Save your code as main.cpp
. Do not ignore this step or save your file(s) with different names.
Submit: Your program source code must be submitted via CodeGrade as a properly named .cpp
file prior to the deadline to receive full credit. Any submissions after the deadline will be subject to the class’ late policy.