Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef RC_H
- #define RC_H
- #include <iostream>
- #include <iomanip>
- using namespace std;
- class Reservation{
- private:
- int bookingNo;
- string name;
- int phoneNo;
- int paxNo;
- int time;
- int date;
- public:
- Reservation(){
- bookingNo = 1;
- name = "Tan Phit Huan";
- phoneNo = 0123456777;
- paxNo = 1;
- time = 1500;
- date = 20190101;
- }
- Reservation(int bNo, string na, int phNo, int pxNo, int t, int da){
- bookingNo = bNo;
- name = na;
- phoneNo = phNo;
- paxNo = pxNo;
- time = t;
- date = da;
- }
- void setBookingNo(int bNo){
- bookingNo = bNo;
- }
- int getBookingNo(){
- return bookingNo;
- }
- void setName(string na){
- name = na;
- }
- string getName(){
- return name;
- }
- void setPhoneNo(int phNo){
- phoneNo = phNo;
- }
- int getPhoneNo(){
- return phoneNo;
- }
- void setPaxNo(int pxNo){
- paxNo = pxNo;
- }
- int getPaxNo(){
- return paxNo;
- }
- void setTime(int t){
- time = t;
- }
- int getTime(){
- return time;
- }
- void setDate(long da){
- date = da;
- }
- int getDate(){
- return date;
- }
- void display(){
- int monthNYear = date/100;
- int year = date/10000;
- int month = monthNYear-(year*100);
- int day = date - (monthNYear*100);
- cout<<"| "<<setfill(' ')<<bookingNo<<" "
- <<left<<setw(30)<<name
- <<right<<setw(10)<<setfill('0')<<phoneNo
- <<setw(12)<<setfill(' ')<<paxNo<<setw(6)<<setfill(' ')<<" "
- <<setw(2)<<setfill('0')<< day <<"/"<<setw(2)<<setfill('0')<< month <<"/"<<setw(4)<<setfill('0')<< year<<setw(7)<<setfill(' ')<<" "
- <<setw(4)<<setfill('0')<< time <<" |"<<endl;
- }
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment