I have a homework problem that i am stuck on. I have to create a triangle (using classes) that a user inputs the height and width. It then translates 3 times and prints the coordinates each time it translates.
This is what i have so far but am stuck.
#include <iostream>
using namespace std;
class rectangle
{
public:
rectangle(int x, int y, int height, int width);
};
int main()
{
cout << "Enter two numbers for width and height"
<< " for your rectangle: \n";
void print();
void trans.right();
void trans.down();
void trans.left();
}
void rectangle :: print()
{
cout << "The width is " << width <<endl;
cout << " And the height is " << height <<endl;
cout << "The origional coordinates are (0,0)";
}
void rect :: trans.right()
{
x = x + width
y = y + height
cout << "The corrdinates are (" << y <<"," << x << ").\n"
<< "After the translation right.";
}