-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckingAccount.cpp
96 lines (65 loc) · 1.54 KB
/
checkingAccount.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include "checkingAccount.h"
#include <iostream>
#include <string>
checkingAccount::checkingAccount(string newName, double newBalance, int newAccNum)
:bankAccount( newName, newBalance, newAccNum),checkCounter(10)
{
this->setAccountType("checking account ");
}
void checkingAccount::displayInfo()
{
bankAccount::displayInfo();
}
void checkingAccount::editMenu()
{
int choise=0;
string newName;
int newBalance;
int accNUmb;
while(choise!=4)
{
cout<<endl<<"\nPlease select what you want to do: "
<<"\n1.Show information of this account"
<<"\n2.Edit owner name "
<<"\n3.Write check "
<<"\n4.Quit to the main menu "<<endl
<<"Enter a value:";
cin>>choise;
switch(choise)
{
case 1:this->displayInfo();break;
case 2:
cout<<"\nWhat is the new name?: "<<endl;
getline(cin,newName);
this->setName(newName);
break;
case 3:
this->writeCheck();
break;
case 4:break;
default:cout<<"\nWrong entry, try again please"<<endl;break;
}
}
}
void checkingAccount::writeCheck()
{
cout<<endl<<"please state how much is the check "
<<endl<<" enter a value:";
double value;
cin>>value;
if(this->getBalance())//see if it is minus
this->setBalance(this->getBalance()-value);
else
cout<<endl<<"wrong value " ;
}
void checkingAccount::editCheckCounter()
{
checkCounter--;
}
int checkingAccount::getCheckCounter()
{
return this->checkCounter;
}
checkingAccount::~checkingAccount()
{
}