From 1131d66fe5a2594b00bfea3734b44cb23ee0e762 Mon Sep 17 00:00:00 2001 From: byj-999 <56639450+byj-999@users.noreply.github.com> Date: Fri, 1 Nov 2019 20:14:37 +0800 Subject: [PATCH 1/9] Create Ex joj --- 201816040221/Ex | 1 + 1 file changed, 1 insertion(+) create mode 100644 201816040221/Ex diff --git a/201816040221/Ex b/201816040221/Ex new file mode 100644 index 0000000..9ff3779 --- /dev/null +++ b/201816040221/Ex @@ -0,0 +1 @@ +kj From 8915e9004602579f9523a1c3d26d013d4e0b5223 Mon Sep 17 00:00:00 2001 From: byj-999 <56639450+byj-999@users.noreply.github.com> Date: Fri, 1 Nov 2019 20:17:14 +0800 Subject: [PATCH 2/9] Create Ex03_13.cpp This is my assignment_03 Student ID :201816040221 --- 201816040221/Ex03_13/Ex03_13.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 201816040221/Ex03_13/Ex03_13.cpp diff --git a/201816040221/Ex03_13/Ex03_13.cpp b/201816040221/Ex03_13/Ex03_13.cpp new file mode 100644 index 0000000..7c2adfb --- /dev/null +++ b/201816040221/Ex03_13/Ex03_13.cpp @@ -0,0 +1,27 @@ +#include +//#include +using namespace std; + +#include "Invoice.h" // include definition of class Employee + +// function main begins program execution +int main() +{ + string a,b; + int x,y; + cout<<"请输入相关量"; + cin>>a; + cin>>b; + cin>>x; + cin>>y; + Invoice Invoice1(a,b,x,y); + + cout< Date: Fri, 1 Nov 2019 20:17:28 +0800 Subject: [PATCH 3/9] Delete Ex --- 201816040221/Ex | 1 - 1 file changed, 1 deletion(-) delete mode 100644 201816040221/Ex diff --git a/201816040221/Ex b/201816040221/Ex deleted file mode 100644 index 9ff3779..0000000 --- a/201816040221/Ex +++ /dev/null @@ -1 +0,0 @@ -kj From 4af2220f078252be766ae44b7366dfe1bfdcd76c Mon Sep 17 00:00:00 2001 From: byj-999 <56639450+byj-999@users.noreply.github.com> Date: Fri, 1 Nov 2019 20:17:59 +0800 Subject: [PATCH 4/9] Create Invoice.cpp This is my assignment_03 Student ID :201816040221 --- 201816040221/Ex03_13/Invoice.cpp | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 201816040221/Ex03_13/Invoice.cpp diff --git a/201816040221/Ex03_13/Invoice.cpp b/201816040221/Ex03_13/Invoice.cpp new file mode 100644 index 0000000..58ec6ff --- /dev/null +++ b/201816040221/Ex03_13/Invoice.cpp @@ -0,0 +1,61 @@ +// Lab 3: Employee.cpp +// Employee class member-function definitions. +#include +#include +#include +#include "Invoice.h" +using namespace std; + +Invoice::Invoice(string PN,string Pd,int sales,int price)//declar the Invoice member +{ + setInvoicePN(PN); + setInvoicePd(Pd); + setInvoicesales(sales); + setInvoiceprice(price); + +} +void Invoice::setInvoicePN(string PN)//declar the PN member +{ + InvoicePN=PN; +} +string Invoice::getInvoicePN() +{ + return InvoicePN; +} +void Invoice::setInvoicePd(string Pd)//declar the Pd member +{ + InvoicePd=Pd; +} +string Invoice::getInvoicePd() +{ + return InvoicePd; +} +void Invoice::setInvoicesales(int sales)//declar the sales memver +{ + Invoicesales=sales; +} +int Invoice::getInvoicesales() +{ + return Invoicesales; +} +void Invoice::setInvoiceprice(int price)//declar the price member +{ + Invoiceprice=price; +} +int Invoice::getInvoiceprice() +{ + return Invoiceprice; +} +int Invoice::InvoiceAmount(int sales,int price)//declar the InvoiceAmount member +{ + if(sales==0||price==0) + { + InvoiceAmount1=0; + } + else + { + InvoiceAmount1=sales*price; + } + + return InvoiceAmount1; +} From 7d33c98e61701db15e21397a57408bb6cba2e104 Mon Sep 17 00:00:00 2001 From: byj-999 <56639450+byj-999@users.noreply.github.com> Date: Fri, 1 Nov 2019 20:20:21 +0800 Subject: [PATCH 5/9] Create Invoice.h This is my assignment_03 Student ID :201816040221 --- 201816040221/Ex03_13/Invoice.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 201816040221/Ex03_13/Invoice.h diff --git a/201816040221/Ex03_13/Invoice.h b/201816040221/Ex03_13/Invoice.h new file mode 100644 index 0000000..23a6b8c --- /dev/null +++ b/201816040221/Ex03_13/Invoice.h @@ -0,0 +1,29 @@ +// Lab 3: Employee.h +// Employee class definition. + +#include // program uses C++ standard string class +using namespace std; +//#define INVOIE_H +// Employee class definition +class Invoice +{ +public://declar the three public member + + Invoice(string,string,int,int); + void setInvoicePN(string); + void setInvoicePd(string); + void setInvoicesales(int); + void setInvoiceprice(int); + string getInvoicePN(); + string getInvoicePd(); + int getInvoicesales(); + int getInvoiceprice(); + int InvoiceAmount(int,int); + +private: + string InvoicePN; + string InvoicePd; + int Invoicesales; + int Invoiceprice,InvoiceAmount; + / +}; // end class Invoice From 07bf7e72621bd0309d66bb07a801ec56cd598806 Mon Sep 17 00:00:00 2001 From: byj-999 <56639450+byj-999@users.noreply.github.com> Date: Fri, 1 Nov 2019 20:21:19 +0800 Subject: [PATCH 6/9] Create Ex03_15.cpp This is my assignment_03 Student ID :201816040221 --- 201816040221/Ex03_15/Ex03_15.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 201816040221/Ex03_15/Ex03_15.cpp diff --git a/201816040221/Ex03_15/Ex03_15.cpp b/201816040221/Ex03_15/Ex03_15.cpp new file mode 100644 index 0000000..5a3b12d --- /dev/null +++ b/201816040221/Ex03_15/Ex03_15.cpp @@ -0,0 +1,29 @@ +// Lab 3: EmployeeTest.cpp +// Create and manipulate two Employee objects. +#include +//#include +using namespace std; + +#include "Date.h" // include definition of class Employee + +// function main begins program execution +int main() +{ + + int a,x,y; + cout<<"ÇëÊäÈëÏà¹ØÁ¿\n"; + cin>>a; + cin>>x; + cin>>y; + Date Date1(a,x,y); + + //cout< Date: Fri, 1 Nov 2019 20:23:01 +0800 Subject: [PATCH 7/9] Create Date.h This is my assignment_03 Student ID :201816040221 --- 201816040221/Ex03_15/Date.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 201816040221/Ex03_15/Date.h diff --git a/201816040221/Ex03_15/Date.h b/201816040221/Ex03_15/Date.h new file mode 100644 index 0000000..f9bfef9 --- /dev/null +++ b/201816040221/Ex03_15/Date.h @@ -0,0 +1,29 @@ +// Lab 3: Employee.h +// Employee class definition. + +#include // program uses C++ standard string class +using namespace std; +//#define INVOIE_H +// Employee class definition +class Date +{ +public://declar the three public member + + Date(int,int,int); + void setDatemonth(int); + void setDateday(int); + void setDateyear(int); + + + int getDatemonth(); + int getDateday(); + int getDateyear(); + + +private: + int Datemonth; + int Dateday; + int Dateyear; + int dissplayDate1(); + +}; // end class date From 477b83fa28df0c2851b3a9685a515a5f777a577f Mon Sep 17 00:00:00 2001 From: byj-999 <56639450+byj-999@users.noreply.github.com> Date: Fri, 1 Nov 2019 20:24:27 +0800 Subject: [PATCH 8/9] Create DateTest.cpp This is my assignment_03 Student ID :201816040221 --- 201816040221/Ex03_15/DateTest.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 201816040221/Ex03_15/DateTest.cpp diff --git a/201816040221/Ex03_15/DateTest.cpp b/201816040221/Ex03_15/DateTest.cpp new file mode 100644 index 0000000..3b903e6 --- /dev/null +++ b/201816040221/Ex03_15/DateTest.cpp @@ -0,0 +1,29 @@ +// Lab 3: EmployeeTest.cpp +// Create and manipulate two Employee objects. +#include +//#include +using namespace std; + +#include "Date.h" // include definition of class Date + +// function main begins program execution +int main() +{ + + int a,x,y; + cout<<"ÇëÊäÈëÏà¹ØÁ¿\n"; + cin>>a; + cin>>x; + cin>>y; + Date Date1(a,x,y); + + //cout< Date: Fri, 1 Nov 2019 20:41:01 +0800 Subject: [PATCH 9/9] Update and rename DateTest.cpp to Date.cpp --- 201816040221/Ex03_15/Date.cpp | 51 +++++++++++++++++++++++++++++++ 201816040221/Ex03_15/DateTest.cpp | 29 ------------------ 2 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 201816040221/Ex03_15/Date.cpp delete mode 100644 201816040221/Ex03_15/DateTest.cpp diff --git a/201816040221/Ex03_15/Date.cpp b/201816040221/Ex03_15/Date.cpp new file mode 100644 index 0000000..11c7265 --- /dev/null +++ b/201816040221/Ex03_15/Date.cpp @@ -0,0 +1,51 @@ +// Lab 3: Employee.cpp +// Employee class member-function definitions. +#include +#include +#include +#include "Date.h" +using namespace std; +Date::Date(int month,int day,int year)//declare three date members +{ + setDatemonth(month); + setDateday(day); + setDateyear(year); + +} +void Date::setDatemonth(int month)//declar the month member +{ + if(month<1||month>12) + { + Datemonth=1; + } + else + { + + + Datemonth=month; + } +} +int Date::getDatemonth() +{ + + return Datemonth; +} +void Date::setDateday(int day)//declar the day member +{ + + Dateday=day; +} +int Date::getDateday() +{ + return Dateday; +} +void Date::setDateyear(int year) +{ + Dateyear=year; +} +int Date::getDateyear() +{ + return Dateyear; +} + + diff --git a/201816040221/Ex03_15/DateTest.cpp b/201816040221/Ex03_15/DateTest.cpp deleted file mode 100644 index 3b903e6..0000000 --- a/201816040221/Ex03_15/DateTest.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// Lab 3: EmployeeTest.cpp -// Create and manipulate two Employee objects. -#include -//#include -using namespace std; - -#include "Date.h" // include definition of class Date - -// function main begins program execution -int main() -{ - - int a,x,y; - cout<<"ÇëÊäÈëÏà¹ØÁ¿\n"; - cin>>a; - cin>>x; - cin>>y; - Date Date1(a,x,y); - - //cout<