triangles.cpp.docx - File triangles.cpp Created by Creation...

This preview shows page 1 - 3 out of 5 pages.

/* File: triangles.cpp Created by: Creation Date: 4/14/2017 Synopsis: Has user enter the x,y coordinate of a right triangle, it's height, and it's length, then has user enter a scaler value to increa size of triangle. */ #include <iostream> #include <cmath> using namespace std; class Point { private: double px; double py; public: void setX(const double x); void setY(const double y); double getX() const; double getY() const; }; class Triangle { private: Point blPoint; double length, height; public: // member functions void setBottomLeftX(const double x); void setBottomLeftY(const double y); void setLength(const double inLength); void setHeight(const double inHeight); Point getBottomLeft() const; Point getBottomRight() const; Point getTopLeft() const; double getLength() const; double getHeight() const; double perimeter() const; double hypotenuse() const; void scaleLength(const double sx); void scaleHeight(const double sy); void display() const; };
// FUNCTION PROTOTYPES GO HERE: void read_triangle(Triangle & tri); int main() { // Define local variables Triangle tri; double sx, sy;

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture