Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * File: Betrag.cpp
- * Author: arnonym
- *
- * Created on November 14, 2010, 10:26 PM
- */
- #include "Betrag.h"
- #include <iostream>
- using namespace std;
- Betrag::Betrag(int euro, int cent) :
- euro(euro),
- cent(cent) {
- }
- Betrag::Betrag(double betrag) :
- euro((int) betrag),
- cent((int) (betrag * 100) - ((int) betrag) * 100) {
- }
- Betrag::~Betrag() {
- }
- int Betrag::getEuro() const {
- return euro;
- }
- int Betrag::getCent() const {
- return cent;
- }
- void Betrag::print() const {
- cout << "Betrag [Euro: " << euro << "; Cent: " << cent << "]";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement