Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Bankomat.h"
- Bankomat::Bankomat(std::string PIN,int AccountNumberPLN,int AccountNumberEUR, float Euro, float PLN )
- {
- this->PIN =PIN;
- this->AccountNumberPLN = AccountNumberPLN;
- this->AccountNumberEURO =AccountNumberEUR;
- this->Euro = Euro;
- this->PLN = PLN;
- this->CorrectPIN = false;
- this->ExchangeRate = 4;
- }
- Bankomat::~Bankomat()
- {
- //dtor
- }
- bool Bankomat::CheckPIN(std::string PIN){
- if(this->PIN == PIN)
- {
- this->CorrectPIN = true;
- std::cout << "\nPoprawny PIN";
- return true;
- }
- this->CorrectPIN = false;
- std::cout << "\nBledny Pin";
- return false;
- }
- void Bankomat::ChangePIN(std::string PIN){
- if(CorrectPIN){
- this->PIN = PIN;
- std::cout << "\nPin zmieniono";
- return;
- }
- std::cout << "\nNajpierw zaloguj sie, pozniej zmie PIN";
- }
- void Bankomat::PayPLN(float PLN){
- if(!CorrectPIN){
- std::cout << "\nNajpierw zaloguj sie";
- return;
- }
- this->PLN += PLN;
- std::cout << "\nWpłacono " << PLN <<" PLN";
- }
- void Bankomat::PayEuro(float Euro){
- if(!CorrectPIN){
- std::cout << "\nNajpierw zaloguj sie";
- return;
- }
- this->Euro +=Euro;
- std::cout << "\nWpłacono " << Euro <<" EURO";
- }
- void Bankomat::WithdrawPLN(float PLN){
- if(!CorrectPIN){
- std::cout << "\nNajpierw zaloguj sie";
- return;
- }
- if(this->PLN < PLN )
- {
- std::cout << "\nZa mało środków na koncie";
- return;
- }
- this->PLN -= PLN;
- std::cout << "\nWypłacono " << PLN <<" PLN";
- }
- void Bankomat::WithdrawEURO(float Euro){
- if(!CorrectPIN){
- std::cout << "\nNajpierw zaloguj sie";
- return;
- }
- if(this->Euro < Euro )
- {
- std::cout << "\nZa mało środków na koncie";
- return;
- }
- this->Euro -= Euro;
- std::cout << "\nWypłacono " << PLN <<" PLN";
- }
- float Bankomat::GetEuroQuantity(){
- if(!CorrectPIN){
- std::cout << "\nNajpierw zaloguj sie";
- return 0;
- }
- return this->Euro;
- }
- float Bankomat::GetPLNQuantity(){
- if(!CorrectPIN){
- std::cout << "\nNajpierw zaloguj sie";
- return 0;
- }
- return this->PLN;
- }
- void Bankomat::ChangePLNToEuro(float PLN){
- if(!CorrectPIN){
- std::cout << "\nNajpierw zaloguj sie";
- return;
- }
- if(this->PLN < PLN){
- std::cout << "\nZa mało środków na koncie";
- return;
- }
- this->Euro += (PLN / 4);
- this->PLN -= PLN;
- std::cout << "\nKupiono " << PLN/4 << " Euro za " << PLN << " PLN";
- }
- void Bankomat::PrintPLN()
- {
- std::cout << "\nNumer Rachunku PLN: " << this->AccountNumberPLN << " Kwota: " << this->PLN < " PLN" ;
- }
- void Bankomat::PrintEURO()
- {
- std::cout << "\nNumer Rachunku EURO: " << this->AccountNumberEURO << " Kwota: " << this->Euro < " EURO" ;
- }
- void Bankomat::Print(){
- PrintPLN();
- PrintEURO();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement