-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservCharegCheck.cpp
56 lines (37 loc) · 1.08 KB
/
servCharegCheck.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
#include <iostream>
#include <string>
#include "servCharegCheck.h"
servCharegCheck::servCharegCheck(string newName, double newBalance, int newAccNum)
:checkingAccount( newName, newBalance, newAccNum)
{
this->setAccountType("service charge checking ");
}
void servCharegCheck::displayInfo()
{
checkingAccount::displayInfo();
cout<<endl<<"You can write "<<getCheckCounter()<<" checks this month,";
}
void servCharegCheck::writeCheck()
{
//To see if counter more than 0, person can write a check for this month
if(getCheckCounter()>0)
{
cout<<endl<<endl
<<"You can write "<<getCheckCounter()<<" checks this month,"
<<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 " ;
//After every time reduce the counter
this->editCheckCounter();
}
else
cout<<endl<<"you used 10 checks this month, this is maximum " ;
}
servCharegCheck::~servCharegCheck()
{
}