Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
- //
- #include "pch.h"
- #include <iostream>
- using namespace std;
- class Point {
- int x;
- int y;
- public:
- Point();
- Point(int, int);
- int getCoordinates(int, int);
- void print();
- };
- class Rectangle : public Point {
- Point *p1;
- Point *p2;
- Point *p3;
- Point *p4;
- public:
- Rectangle();
- Rectangle(int, int, int, int);
- void printALL();
- };
- class RectangularPrism : public Rectangle {
- int height;
- public:
- RectangularPrism();
- RectangularPrism(int, int, int, int, int);
- void print();
- };
- int main()
- {
- Rectangle coordinates;
- coordinates.Point::Point(1, 1);
- coordinates.Rectangle::Rectangle(1, 1, 1, 1);
- coordinates.printALL();
- }
- Point::Point()
- {
- x = 0;
- y = 0;
- }
- Point::Point(int tempx, int tempy)
- {
- x = tempx;
- y = tempy;
- }
- int Point::getCoordinates(int tempx, int tempy)
- {
- return x;
- return y;
- }
- void Point::print()
- {
- cout << "(" << x << ", " << y << ")\n";
- }
- Rectangle::Rectangle()
- {
- Point *p1 = new Point;
- Point *p2 = new Point;
- Point *p3 = new Point;
- Point *p4 = new Point;
- }
- Rectangle::Rectangle(int tempx, int tempy, int tempx1, int tempy1) : Point(tempx, tempy)
- {
- //Point *p2 = ;
- //Point *p3 = ;
- //Point *p4 = ;
- }
- void Rectangle::printALL()
- {
- Point::print();
- cout << p1 << endl;
- cout << p2 << endl;
- cout << p3 << endl;
- cout << p4 << endl;
- }
- RectangularPrism::RectangularPrism()
- {
- height = 0;
- }
- RectangularPrism::RectangularPrism(int, int, int, int, int)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement