Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. /*
  2. * File: Betrag.cpp
  3. * Author: arnonym
  4. *
  5. * Created on November 14, 2010, 10:26 PM
  6. */
  7.  
  8. #include "Betrag.h"
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13. Betrag::Betrag(int euro, int cent) :
  14. euro(euro),
  15. cent(cent) {
  16. }
  17.  
  18. Betrag::Betrag(double betrag) :
  19. euro((int) betrag),
  20. cent((int) (betrag * 100) - ((int) betrag) * 100) {
  21. }
  22.  
  23. Betrag::~Betrag() {
  24. }
  25.  
  26. int Betrag::getEuro() const {
  27. return euro;
  28. }
  29.  
  30. int Betrag::getCent() const {
  31. return cent;
  32. }
  33.  
  34. void Betrag::print() const {
  35. cout << "Betrag [Euro: " << euro << "; Cent: " << cent << "]";
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement