Header classes

Goals:
Through the completion of this assignment students should familiarize themselves with the creation of an interface. Students should understand the purpose of organizing methods into an interface so that multiple classes can share the same functionality. Students should also note that implementation of an interface provides a simple way for classes to be organized within a single category without the need for complex inheritance, which can be troublesome and easily leads to code rot — software that loses its reusability over time.

Files to be Submitted:
In this assignment students should create five header classes called Point, Circle, Rectangle, Square, FigureGeometry and one cpp file TestAll. The TestAll class should implement a main method which tests all of the other files created in the assignment. After the assignment has been completed, all six files should be submitted for grading into the Dropbox for Assignment 3, which can be found in the Dropbox menu on the course website. Students should note that only the *.h or .cpp file for each class needs to be submitted.
Please click on each of the following links to view specific requirements for the files that must be created and submitted: (File criteria are listed below)
1. Requirements: Point.h
2. Requirements: FigureGeometry.h
3. Requirements: Circle.h
4. Requirements: Rectangle.h
5. Requirements: Square.h
6. Requirements: TestAll.cpp

Requirements: TestAll.cpp

Description:
The TestAll class should be declared as a class and should meet all the requirements listed below. Its purpose is to implement a main method which creates three objects — a Circle object, a Square object, and a Rectangle object — and test each of the files that have been designed for the Chapter 3 Assignment.

Requirements: FigureGeometry.h

Description:
The FigureGeometry interface should be declared as a class FigureGeometry and should meet all the requirements listed below. Its purpose is to declare all the necessary methods that any geometric figure, such as a circle, rectangle, or square, should contain. The FigureGeometry interface should also declare a numeric constant, called PI, which can be used by classes that include the FigureGeometry interface. Students should also note that the inclusion of instance variables within an interface declaration is not allowed; only static constants may be defined within an interface declaration.

Requirements: Circle.h

Description:
The Circle class should be declared as a public class that includes the FigureGeometry interface described in the Chapter 3 Assignment sheet and should meet all the requirements listed below. Its purpose is to store the radius of a circular figure and provide the methods necessary to calculate the area and perimeter of such a figure.

 

Requirements: Rectangle.h

Description:
The Rectangle class should be declared as a public class that implements the FigureGeometry interface described in the Chapter 3 Assignment sheet and should meet all the requirements listed below. Its purpose is to store the Point of a rectangular figure (using the Point class described in the Chapter 3 Assignment sheet) and provide the methods necessary to calculate the area and perimeter of such a figure.

 

Requirements: Square.h

Description:
The Square class should be declared as a class that includes the FigureGeometry interface described in the Chapter 3 Assignment sheet and should meet all the requirements listed below. Its purpose is to store the Point of a square figure (using the Point class described in the Chapter 3 Assignment sheet) and provide the methods necessary to calculate the area and perimeter of such a figure.

 

Requirements: Point.h
Description:
The Point class should be declared as a class and should meet all the requirements listed below. Its purpose is to store the Point (width and height) of a two-dimensional, rectangular geometric figure.