Question: Please submit the following java programs in a single zipped folder on Canvas: Octagonal Prism (60 pts) - OctPrism.java Driver Program (40 pts) OctDriver.java Extra
Please submit the following java programs in a single zipped folder on Canvas:
Octagonal Prism (60 pts) - OctPrism.java
Driver Program (40 pts) OctDriver.java
Extra Credit: Square Table (10pts) SquareTable.java
Surface Area and Volume of a Right Regular Octagonal Prism
A right regular octagonal prism is a geometric figure with octagons at its top and base (shown below)

The surface area and volume of this type of prism are:

where a represents the base edge and h represents the height.
Write a class called OctPrism that contains the necessary information for storing and calculating the surface area and volume of a octagonal prism. In particular, the class should have:
members to store the base and height data
a constructor that accepts no parameters that initializes base and height to 0.0
mutators for the base and height
accessors for the base, height, area, and volume
Write a program that demonstrates the OctPrism class by:
creating an OctPrism object
asking the user for the base and height of the prism
reporting the base, height, area and volume
the base and height should be referenced in the output by using the appropriate accessors
The area and volume results should be set to 4 decimal places
Samples of the output are shown below:
Sample Output 1:
Enter the base edge of an Octagonal Prism: 5 Enter the height of an Octagonal Prism: 7 Given an octagonal prism with a base edge of 5.0 units, and height of 7.0 units: The area is: 521.4214 units squared. The volume is: 844.9747 units cubed.
Sample Output 2:
Enter the base edge of an Octagonal Prism: 10 Enter the height of an Octagonal Prism: 3 Given an octagonal prism with a base edge of 10.0 units, and height of 3.0 units: The area is: 1205.6854 units squared. The volume is: 1448.5281 units cubed.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
