-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is my assignment_03 Student ID:201816040205
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#include <iostream> | ||
#include "Invoice.h" | ||
using namespace std; | ||
|
||
Invoice::Invoice(string number,string discribe,int sale,int price)//define structor | ||
{ | ||
setNumber(number); | ||
setDiscribe(discribe); | ||
setSale(sale); | ||
setPrice(price); | ||
} | ||
|
||
void Invoice::setNumber(string num)//definr set and get functions | ||
{ | ||
|
||
Number=num; | ||
|
||
|
||
} | ||
|
||
void Invoice::setDiscribe(string dis) | ||
{ | ||
|
||
Discribe=dis; | ||
|
||
|
||
} | ||
|
||
void Invoice::setSale(int sal) | ||
|
||
{ | ||
if(sal>=0) | ||
Sale=sal; | ||
else | ||
Sale=0; | ||
} | ||
|
||
void Invoice::setPrice(int pri) | ||
|
||
{ | ||
if(pri>=0) | ||
Price=pri; | ||
else | ||
Price=0; | ||
} | ||
|
||
string Invoice::getNumber() | ||
{ | ||
return Number; | ||
} | ||
|
||
string Invoice::getDiscribe() | ||
{ | ||
return Discribe; | ||
} | ||
|
||
int Invoice::getSale() | ||
{ | ||
return Sale; | ||
} | ||
|
||
int Invoice::getPrice() | ||
{ | ||
return Price; | ||
} | ||
|
||
int Invoice::getInvoiceAmount() | ||
{ | ||
return Price*Sale; | ||
} |