Skip to content

Commit

Permalink
Create Invoice.cpp
Browse files Browse the repository at this point in the history
This is my assignment_03
Student ID:201816040205
  • Loading branch information
Misakachu authored Nov 1, 2019
1 parent b96e187 commit ef76a56
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions 201816040205/Ex03_13/Invoice.cpp
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;
}

0 comments on commit ef76a56

Please sign in to comment.