-
Notifications
You must be signed in to change notification settings - Fork 5
/
Refund.h
84 lines (68 loc) · 1.88 KB
/
Refund.h
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
#include <iostream>
#include <cstring>
using namespace std ;
class Payment
{
private :
string orderID ;
string pType ;
string SID ;
string CID ;
double amount ;
Order *order[5] ;
public :
Payment () {}
Payment(string pSID , string pCID , string porderID , float PAmount , string pPType ) {
SID = pSID ;
CID = pCID ;
orderID = porderID ;
amount = PAmount ;
pType = pPType ;
}
float getAmount()
{
return amount ;
}
void printSlip()
{
cout <<"******************************************" <<endl ;
cout <<"Student ID = "<< SID <<endl ;
cout <<"Course ID = "<< CID <<endl ;
cout <<"Order ID = "<< orderID <<endl ;
cout <<"Total Amount = "<< amount <<endl ;
cout <<"Payment Type = "<< pType <<endl ;
cout <<"******************************************" <<endl<<endl ;
}
};
class Refund
{
private :
string RID ;
string SID ;
string CID ;
string reason ;
float refund = 0 ;
public :
Refund(string pSID , string pCID , string pRID , string preason ){
RID = pRID ;
reason = preason ;
SID = pSID ;
CID = pCID ;
refund = 0 ;
}
void addRefund(Payment *P){
refund = 0.9 * P->getAmount() ;
}
void display()
{
cout << "Your refund request has been granted by the System Admin."<< endl ;
cout << "You have received a 90% of discount of your course payment." <<endl<<endl ;
cout << "***********************************************************"<<endl ;
cout << "Refund ID = "<< RID << endl ;
cout << "Student ID = "<< SID << endl ;
cout << "Course ID = "<< CID <<endl ;
cout << "Reason for request refund = "<< reason << endl ;
cout << "Refund = "<<refund << endl ;
cout << "***********************************************************"<<endl<<endl ;
}
};