1
0
mirror of https://github.com/2martens/uni.git synced 2026-05-06 19:36:26 +02:00

[CCV] Finished exercise 2

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2017-04-04 15:26:53 +02:00
parent 5123ae2bd3
commit e26a936bc1
4 changed files with 46 additions and 22 deletions

View File

@ -2,29 +2,16 @@
// Created by jim on 4/4/17.
//
#include <iostream>
#include "Rectangle.h"
using namespace std;
class Rectangle
Rectangle::Rectangle(unsigned int width, unsigned int height)
{
private:
unsigned int width;
unsigned int height;
public:
Rectangle(unsigned int width, unsigned int height)
{
this->width = width;
this->height = height;
}
unsigned int area()
{
return this->height * this->width;
}
};
int main()
{
Rectangle* rec = new Rectangle(10, 20);
cout << rec->area() << endl;
this->width = width;
this->height = height;
}
unsigned int Rectangle::area()
{
cout << this->width * this->height << endl;
}