Question: Using jGRASP I need the code to run this program please!! Grading criteria: 80% - Functionality: Runs correctly, generating correct outputs. A program that does

Using jGRASP I need the code to run this program please!!

Grading criteria:

80% - Functionality: Runs correctly, generating correct outputs. A program that does not compile will be heavily penalized.

10% - Style: Use consistent indentation to emphasize block structure; variables have meaningful names.

10% - Comments: Comment major code segments adequately.

---------------------------------------------------------------------------------------------------------

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)

Using jGRASP I need the code to run this program

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

Using jGRASP I need the code to run this program

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.

Extra Credit: Square Table

Write a program that uses a two-dimensional array to store and display the following values in a 5 x 5 table:

1 2 3 4 5 4 8 12 16 20 9 18 27 36 45 16 32 48 64 80 25 50 75 100 125

Your program should generate (i.e. calculate) the numbers so that:

The first five numbers 1 5 are displayed in the first row

The square of the first 5 numbers are displayed in the first column

The remaining values are multiples of the values in the first row and column

(Your program should output the numbers in a neat format, but do not worry if the larger values are slightly out of alignment.

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!