Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A Reagular Octagon is a two-dimensional geometric shape that has 8 equal-length

ID: 3694120 • Letter: A

Question

A Reagular Octagon is a two-dimensional geometric shape that has 8 equal-length sides. For this question you will be finding the surface a tea and perimeter of a Regular Octagon. You will need the following equations to calculate these two values: Surface Area = two times (one plus the squareroot of two) times the length of a side squared. or 2 (1 + Squareroot2) a^2 The cmath library function "double sqrt(double)" should be used to calculate the squareroot. Perimeter = eight times the length of the side (a) or 8(a) Design and implement the Octogon class based on the following class specification: By default this class will have a side length of 1, otherwise a side can be specified in a constructor. There should be a setter for all private data members There should be a getter for all private data members. There should be a function to return the surface area of the octagon. There should be a function to return the perimeter of the octagon.

Explanation / Answer

program:

   public abstract class GeometricObject
{
private String color = "white";
private boolean filled;
private java.util.Date dateCreated;
protected GeometricObject()
{
dateCreated = new java.util.Date();
}
public String getColor()
{
return color;
}
public void setColor(String color)
{
this.color = color;
}
public boolean isFilled()
{
return filled;
}
public void setFilled(boolean filled)
{
this.filled = filled;
}
public java.util.Date getDateCreated()
{
return dateCreated;
}
public String toString()
{
return "Created on: " + dateCreated + " Color: " + color + " and filled: " + filled;
}
public abstract double getArea();
public abstract double getPerimeter();   
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote