Untitled
unknown
plain_text
7 months ago
1.9 kB
6
Indexable
Never
/* *************************************************************** * Header File: Area classes csc102 H001 * Program Name: w10178836-P02.cpp * Name: Sarah Mirza * StuID: w10178836 * Date: 18 March 2024 * * Objectives/Description: These header files define classes for geometric shapes. * Input: Dimensions * Output: it facilitate computation and display the area and perimeter of the selected geometric shape. * *************************************************************** */ #ifndef SQUARE_H #define SQUARE_H class Square { private: double side; public: Square(); void setSide(double s); double getArea() const; double getPerimeter() const; }; #endif // SQUARE_H #pragma once #ifndef RECTANGLE_H #define RECTANGLE_H class Rectangle { private: double length; double width; public: Rectangle(); void setDimensions(double l, double w); double getArea() const; double getPerimeter() const; }; #endif // RECTANGLE_H #ifndef TRIANGLE_H #define TRIANGLE_H class Triangle { private: double side1; double side2; double height; public: Triangle(); void setDimensions(double s1, double s2, double h); double getArea() const; double getPerimeter() const; }; #endif // TRIANGLE_H #ifndef CIRCLE_H #define CIRCLE_H class Circle { private: double radius; public: Circle(); void setRadius(double r); double getArea() const; double getPerimeter() const; }; #endif // CIRCLE_H #ifndef TRAPEZOID_H #define TRAPEZOID_H class Trapezoid { private: double base1; double base2; double side1; double side2; double height; public: Trapezoid(); void setDimensions(double b1, double b2, double s1, double s2, double h); double getArea() const; double getPerimeter() const; }; #endif // TRAPEZOID_H
Leave a Comment