From 0bacfa7f68b0f12fc3b6808db9a464b40b5cbc45 Mon Sep 17 00:00:00 2001 From: zhouyuxaing <56668463+zhouyuxaing@users.noreply.github.com> Date: Fri, 1 Nov 2019 10:48:01 +0800 Subject: [PATCH 01/12] Create Ex03_13.cpp This my Assignment_03; Student ID:201816040319; --- 201816040319/Ex03_13.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 201816040319/Ex03_13.cpp diff --git a/201816040319/Ex03_13.cpp b/201816040319/Ex03_13.cpp new file mode 100644 index 0000000..d169a4e --- /dev/null +++ b/201816040319/Ex03_13.cpp @@ -0,0 +1,37 @@ +// github 3.13 +// Invoice class definition. + +#include +using namespace std; + +#include "Invoice.h" // include definition of class Invoice + +// function main begins program execution +int main() +{ + string Number; + string Style; + int Sell; + int Price; + + cout <<"零件号:"<>Number; + cout <<"零件描述:"<>Style; + cout <<"销售总量:"<>Sell; + cout <<"单价:"<>Price; + + Invoice invoice(Number,Style,Sell,Price); + + cout <<"验证数据:"< Date: Fri, 1 Nov 2019 10:49:35 +0800 Subject: [PATCH 02/12] Delete Ex03_13.cpp --- 201816040319/Ex03_13.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 201816040319/Ex03_13.cpp diff --git a/201816040319/Ex03_13.cpp b/201816040319/Ex03_13.cpp deleted file mode 100644 index d169a4e..0000000 --- a/201816040319/Ex03_13.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// github 3.13 -// Invoice class definition. - -#include -using namespace std; - -#include "Invoice.h" // include definition of class Invoice - -// function main begins program execution -int main() -{ - string Number; - string Style; - int Sell; - int Price; - - cout <<"零件号:"<>Number; - cout <<"零件描述:"<>Style; - cout <<"销售总量:"<>Sell; - cout <<"单价:"<>Price; - - Invoice invoice(Number,Style,Sell,Price); - - cout <<"验证数据:"< Date: Fri, 1 Nov 2019 10:51:46 +0800 Subject: [PATCH 03/12] Create Ex03_13.cpp this is my Assignment; Student ID:201816040319 --- 201816040319/Ex03_13.cpp/Ex03_13.cpp | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 201816040319/Ex03_13.cpp/Ex03_13.cpp diff --git a/201816040319/Ex03_13.cpp/Ex03_13.cpp b/201816040319/Ex03_13.cpp/Ex03_13.cpp new file mode 100644 index 0000000..d169a4e --- /dev/null +++ b/201816040319/Ex03_13.cpp/Ex03_13.cpp @@ -0,0 +1,37 @@ +// github 3.13 +// Invoice class definition. + +#include +using namespace std; + +#include "Invoice.h" // include definition of class Invoice + +// function main begins program execution +int main() +{ + string Number; + string Style; + int Sell; + int Price; + + cout <<"零件号:"<>Number; + cout <<"零件描述:"<>Style; + cout <<"销售总量:"<>Sell; + cout <<"单价:"<>Price; + + Invoice invoice(Number,Style,Sell,Price); + + cout <<"验证数据:"< Date: Fri, 1 Nov 2019 10:54:10 +0800 Subject: [PATCH 04/12] Delete Ex03_13.cpp --- 201816040319/Ex03_13.cpp/Ex03_13.cpp | 37 ---------------------------- 1 file changed, 37 deletions(-) delete mode 100644 201816040319/Ex03_13.cpp/Ex03_13.cpp diff --git a/201816040319/Ex03_13.cpp/Ex03_13.cpp b/201816040319/Ex03_13.cpp/Ex03_13.cpp deleted file mode 100644 index d169a4e..0000000 --- a/201816040319/Ex03_13.cpp/Ex03_13.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// github 3.13 -// Invoice class definition. - -#include -using namespace std; - -#include "Invoice.h" // include definition of class Invoice - -// function main begins program execution -int main() -{ - string Number; - string Style; - int Sell; - int Price; - - cout <<"零件号:"<>Number; - cout <<"零件描述:"<>Style; - cout <<"销售总量:"<>Sell; - cout <<"单价:"<>Price; - - Invoice invoice(Number,Style,Sell,Price); - - cout <<"验证数据:"< Date: Fri, 1 Nov 2019 10:55:42 +0800 Subject: [PATCH 05/12] Create Ex03_13.cpp this is my Assignment; student ID:201816040319 --- 201816040319/Ex03_13/Ex03_13.cpp | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 201816040319/Ex03_13/Ex03_13.cpp diff --git a/201816040319/Ex03_13/Ex03_13.cpp b/201816040319/Ex03_13/Ex03_13.cpp new file mode 100644 index 0000000..d169a4e --- /dev/null +++ b/201816040319/Ex03_13/Ex03_13.cpp @@ -0,0 +1,37 @@ +// github 3.13 +// Invoice class definition. + +#include +using namespace std; + +#include "Invoice.h" // include definition of class Invoice + +// function main begins program execution +int main() +{ + string Number; + string Style; + int Sell; + int Price; + + cout <<"零件号:"<>Number; + cout <<"零件描述:"<>Style; + cout <<"销售总量:"<>Sell; + cout <<"单价:"<>Price; + + Invoice invoice(Number,Style,Sell,Price); + + cout <<"验证数据:"< Date: Fri, 1 Nov 2019 10:57:35 +0800 Subject: [PATCH 06/12] Create Invoice.cpp this is my Assignment; student ID:201816040319 --- 201816040319/Ex03_13/Invoice.cpp | 65 ++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 201816040319/Ex03_13/Invoice.cpp diff --git a/201816040319/Ex03_13/Invoice.cpp b/201816040319/Ex03_13/Invoice.cpp new file mode 100644 index 0000000..c61952f --- /dev/null +++ b/201816040319/Ex03_13/Invoice.cpp @@ -0,0 +1,65 @@ +// Invoice.cpp +// class member-function definitions. +#include +using namespace std;Invoice + +#include "Invoice.h" // Invoice class definition + + +Invoice::Invoice(string number,string style ,int sell ,int price ) +{ + setInvoiceNumber(number); + setInvoiceStyle(style); + setInvoiceSell(sell); + setInvoicePrice(price); + +} + //Number + void Invoice::setInvoiceNumber(string Number) + { + number=Number; + } + string Invoice::getInvoiceNumber() + { + return number; + } + + //style + void Invoice::setInvoiceStyle(string Style) + { + style=Style; + } + string Invoice::getInvoiceStyle() + { + return style; + } + + //Sell + void Invoice::setInvoiceSell(int Sell) + { + if(Sell<=0) + sell=0; + else + sell=Sell; + } + int Invoice::getInvoiceSell() + { + return sell; + } + //price + void Invoice::setInvoicePrice(int Price) + { + if(Price<=0) + price=0; + else + price=Price; + } + int Invoice::getInvoicePrice() + { + return price; + } + //Ammount + int Invoice::getInvoiceAmmount() + { + return sell*price; + } From 7ef457740eac53b48c183d8222e1a30a7b0e8270 Mon Sep 17 00:00:00 2001 From: zhouyuxaing <56668463+zhouyuxaing@users.noreply.github.com> Date: Fri, 1 Nov 2019 10:59:23 +0800 Subject: [PATCH 07/12] Create Invoice.h this is my assignment; student Id:201816040319 --- 201816040319/Ex03_13/Invoice.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 201816040319/Ex03_13/Invoice.h diff --git a/201816040319/Ex03_13/Invoice.h b/201816040319/Ex03_13/Invoice.h new file mode 100644 index 0000000..8c33d72 --- /dev/null +++ b/201816040319/Ex03_13/Invoice.h @@ -0,0 +1,29 @@ +// github 3.13 +// Invoice class definition. + +#include // program uses C++ standard string class +using namespace std; + +// Invoice class definition +class Invoice +{ +public: + Invoice(string number ,string style ,int sell ,int price ); + + void setInvoiceNumber(string Number); + string getInvoiceNumber(); + void setInvoiceStyle(string Style); + string getInvoiceStyle(); + void setInvoiceSell(int Sell); + int getInvoiceSell(); + void setInvoicePrice(int Price); + int getInvoicePrice(); + int getInvoiceAmmount(); + +private: + string number; + string style; + int sell ; + int price; + +}; // end class Invoice From 1db8b23e1a37cbfc06e9b3756218df0f17a985c1 Mon Sep 17 00:00:00 2001 From: zhouyuxaing <56668463+zhouyuxaing@users.noreply.github.com> Date: Fri, 1 Nov 2019 11:01:13 +0800 Subject: [PATCH 08/12] Create Ex03_15.cpp this is my Assignment 03; student ID201816040319 --- 201816040319/Ex03_15/Ex03_15.cpp | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 201816040319/Ex03_15/Ex03_15.cpp diff --git a/201816040319/Ex03_15/Ex03_15.cpp b/201816040319/Ex03_15/Ex03_15.cpp new file mode 100644 index 0000000..3944ba0 --- /dev/null +++ b/201816040319/Ex03_15/Ex03_15.cpp @@ -0,0 +1,35 @@ + +// Create Date objects. +#include +using namespace std; + +#include "Date.h" // include definition of class Date + +// function main begins program execution +int main() +{ + int Month; + int Day; + int Year; + cout <<"plese input your number"<>Month; + cout <<"Day"<>Day; + cout <<"Year"<>Year; + + Date date(Month,Day,Year); + + + cout <<"检验数据:"< Date: Fri, 1 Nov 2019 11:02:19 +0800 Subject: [PATCH 09/12] Create Date.cpp this is my Assignment_03; student ID:201816040319 --- 201816040319/Ex03_15/Date.cpp | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 201816040319/Ex03_15/Date.cpp diff --git a/201816040319/Ex03_15/Date.cpp b/201816040319/Ex03_15/Date.cpp new file mode 100644 index 0000000..2b9bd26 --- /dev/null +++ b/201816040319/Ex03_15/Date.cpp @@ -0,0 +1,49 @@ + +// Date class member-function definitions. +#include +using namespace std; + +#include "Date.h" // Date class definition + +Date::Date(int month,int day,int year) +{ + + setDateMonth(month); + setDateDay(day); + setDateYear(year); +} +//Year +void Date::setDateYear(int Year) +{ + year=Year; +} +int Date::getDateYear() +{ + return year; +} +//Month +void Date::setDateMonth(int Month) +{ + if(Month>=13) + month=1; + else + month=Month; +} +int Date::getDateMonth() +{ + return month; +} +//Day +void Date::setDateDay(int Day) +{ + day=Day; +} +int Date::getDateDay() +{ + return day; +} + +void Date::getdisplayDate( ) +{ + cout<<"month/day/year:"< Date: Fri, 1 Nov 2019 11:03:28 +0800 Subject: [PATCH 10/12] Create Date.h this is my Assignment_03 student ID_2015816040319 --- 201816040319/Ex03_15/Date.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 201816040319/Ex03_15/Date.h diff --git a/201816040319/Ex03_15/Date.h b/201816040319/Ex03_15/Date.h new file mode 100644 index 0000000..85291e0 --- /dev/null +++ b/201816040319/Ex03_15/Date.h @@ -0,0 +1,26 @@ +// gitub——3.15 +// Date class definition. + +#include // program uses C++ standard string class +using namespace std; + +// Date class definition +class Date +{ +public: + Date(int year,int month,int day); + + void setDateYear(int Year); + int getDateYear(); + void setDateMonth(int Month); + int getDateMonth(); + void setDateDay(int Day); + int getDateDay(); + void getdisplayDate( ); + +private: + int year; + int month; + int day; + +}; // end class Employee From 6d26c536d7e0e6170ea568d12dad503594be1099 Mon Sep 17 00:00:00 2001 From: zhouyuxaing <56668463+zhouyuxaing@users.noreply.github.com> Date: Fri, 1 Nov 2019 11:03:44 +0800 Subject: [PATCH 11/12] Delete Date.cpp --- 201816040319/Ex03_15/Date.cpp | 49 ----------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 201816040319/Ex03_15/Date.cpp diff --git a/201816040319/Ex03_15/Date.cpp b/201816040319/Ex03_15/Date.cpp deleted file mode 100644 index 2b9bd26..0000000 --- a/201816040319/Ex03_15/Date.cpp +++ /dev/null @@ -1,49 +0,0 @@ - -// Date class member-function definitions. -#include -using namespace std; - -#include "Date.h" // Date class definition - -Date::Date(int month,int day,int year) -{ - - setDateMonth(month); - setDateDay(day); - setDateYear(year); -} -//Year -void Date::setDateYear(int Year) -{ - year=Year; -} -int Date::getDateYear() -{ - return year; -} -//Month -void Date::setDateMonth(int Month) -{ - if(Month>=13) - month=1; - else - month=Month; -} -int Date::getDateMonth() -{ - return month; -} -//Day -void Date::setDateDay(int Day) -{ - day=Day; -} -int Date::getDateDay() -{ - return day; -} - -void Date::getdisplayDate( ) -{ - cout<<"month/day/year:"< Date: Fri, 1 Nov 2019 11:07:56 +0800 Subject: [PATCH 12/12] Create Date.cpp this is my Assignment_03; student ID:201816040319 --- 201816040319/Ex03_15/Date.cpp | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 201816040319/Ex03_15/Date.cpp diff --git a/201816040319/Ex03_15/Date.cpp b/201816040319/Ex03_15/Date.cpp new file mode 100644 index 0000000..2b9bd26 --- /dev/null +++ b/201816040319/Ex03_15/Date.cpp @@ -0,0 +1,49 @@ + +// Date class member-function definitions. +#include +using namespace std; + +#include "Date.h" // Date class definition + +Date::Date(int month,int day,int year) +{ + + setDateMonth(month); + setDateDay(day); + setDateYear(year); +} +//Year +void Date::setDateYear(int Year) +{ + year=Year; +} +int Date::getDateYear() +{ + return year; +} +//Month +void Date::setDateMonth(int Month) +{ + if(Month>=13) + month=1; + else + month=Month; +} +int Date::getDateMonth() +{ + return month; +} +//Day +void Date::setDateDay(int Day) +{ + day=Day; +} +int Date::getDateDay() +{ + return day; +} + +void Date::getdisplayDate( ) +{ + cout<<"month/day/year:"<