Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. // Rechthoek.cpp : main project file.
  2.  
  3. #include "stdafx.h"
  4. #include <iostream>
  5. #include <iomanip>
  6.  
  7. using namespace std;
  8.  
  9. class Rechthoek {
  10.  
  11. private:
  12. int hoogte;
  13. int breedte;
  14.  
  15. public:
  16. Rechthoek(int hoogte, int breedte);
  17. void print();
  18.  
  19. };
  20.  
  21. int main(array<System::String ^> ^args)
  22. {
  23. Rechthoek rechthoek(5, 10);
  24. rechthoek.print();
  25. cin.get();
  26. return 0;
  27. }
  28.  
  29. Rechthoek::Rechthoek(int h, int b) {
  30. hoogte = h;
  31. breedte = b;
  32. }
  33.  
  34. void Rechthoek::print() {
  35. for(int i = 0; i < hoogte; i++) {
  36. for(int j = 0; j < breedte; j++) {
  37. cout << "*";
  38. }
  39. cout << endl;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement