Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Rechthoek.cpp : main project file.
- #include "stdafx.h"
- #include <iostream>
- #include <iomanip>
- using namespace std;
- class Rechthoek {
- private:
- int hoogte;
- int breedte;
- public:
- Rechthoek(int hoogte, int breedte);
- void print();
- };
- int main(array<System::String ^> ^args)
- {
- Rechthoek rechthoek(5, 10);
- rechthoek.print();
- cin.get();
- return 0;
- }
- Rechthoek::Rechthoek(int h, int b) {
- hoogte = h;
- breedte = b;
- }
- void Rechthoek::print() {
- for(int i = 0; i < hoogte; i++) {
- for(int j = 0; j < breedte; j++) {
- cout << "*";
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement