/* 
	KHOR YONG XIN                A19EC0061
	HAM JING YI                  A19EC0048
	AZRIANA BT ZAINAL ABIDIN     A19EC0027
	NOR HAFIYZHA BT MD HUSNI     A19EC0124
*/

#include<iostream>
#include<iomanip>
#include<fstream>
#include<cstdlib>
#include<cctype>
#include<cstring>
#define r 5

using namespace std;


class Order
{
	private:
		string order_book,orderIC;
		int order_code,order_quantity;
		
	public:
		Order(){}
		Order(string,int ,int);
		void setOrderIC(string);
		void menu();
		int getCode() const;
		void printOrder(string);
		void viewOrder();
		void viewCancel();	
};

Order::Order(string order_book,int order_code,int order_quantity)
{
	this->order_book=order_book;
	this->order_code=order_code;
	this->order_quantity=order_quantity;
}
		
void Order:: setOrderIC(string a) 
{
	orderIC=a;
}
		
void Order::menu()
{
	ifstream input("stock.txt");
	cout<<setw(80)<<"________________________________________"<<endl;
	cout<< "\t\t\t\t\t   CODE\t\t\tBOOKS\t"<<endl
		<<setw(80)<<"________________________________________"<<endl;
			
	if(input.fail())
	{
		cout<<"File not found."<<endl;
		exit(0);
	}

	Order m[r];
	for(int i=0;i<r;i++)
	{	
		input>>m[i].order_book>>m[i].order_code>>m[i].order_quantity;
		cout<<"\t\t"<<setw(31)<<m[i].order_code<<"\t"<<right<<setw(26)<<m[i].order_book<<endl;
	}
	
	cout <<setw(80)<< "________________________________________"<<endl;
	input.close();
}
		
int Order:: getCode() const
{
	return order_code;
}
		
void Order::printOrder(string A)
{
	if (A=="Order.txt")
	{
		string filenameOrder=orderIC+A;
		fstream outfile(filenameOrder.c_str(),ios::app);
		outfile<<order_code<<" "<<order_book<<" "<<order_quantity<<endl;
		outfile.close();
				
		cout<<"\t\tOrder is successfully placed!"<<endl;
				
		fstream out(A.c_str(),ios::app);
		out<<order_code<<" "<<order_book<<" "<<order_quantity<<endl;
		out.close();
	}
			
	else if (A=="Cancel.txt")
	{
		string filenameCancel=orderIC+A;
		fstream outfile(filenameCancel.c_str(),ios::app);
		outfile<<order_code<<" "<<order_book<<" "<<order_quantity<<endl;
		outfile.close();
				
		cout<<"\n\t\t\t\tItem is successfully cancelled!"<<endl;
				
		fstream out(A.c_str(),ios::app);
		out<<order_code<<" "<<order_book<<" "<<order_quantity<<endl;
		out.close();
	}
}

void Order::viewOrder() 
{
	string filenameOrder=orderIC+"Order.txt";
	ifstream infile(filenameOrder.c_str());
			
	if(!infile)
	{
		cout<<"File not found."<<endl;
		exit(0);
	}
			
	system ("cls");
	cout<< endl<<endl<<endl;	
	cout<<"\t\t\t\t View Order list"<<endl
		<<"\t\t______________________________________________________________________"<<endl	
		<<"\t\t CODE\t   \tBOOKS\t\t\t    QUANTITY"<<endl
		<<"\t\t______________________________________________________________________"<<endl;
			
	int c,q;
	string book;
			
	while(infile>>c)
	{	
		infile>>book>>q;
		cout<<setw(8)<<"\t\t"<<c<<"\t"<<setw(20)<<book<<setw(20)<<q<<endl;
	}
			
	infile.close();
}
		
void Order::viewCancel()
{
	string filenameCancel=orderIC+"Cancel.txt";
	ifstream infile(filenameCancel.c_str());
			
	if(!infile)
	{
		cout<<"File not found."<<endl;
		exit(0);
	}
		
	system ("cls");
			
	cout<<"\t\t\t\t View Cancel list"<<endl
		<<"\t\t______________________________________________________________________"<<endl	
		<<"\t\tCODE\t   \tCANCELED ITEM\t\t    QUANTITY"<<endl
		<<"\t\t______________________________________________________________________"<<endl;
			
	int c,q;
	string book;
			
	while(infile>>c)
	{	
		infile>>book>>q;
		cout<<setw(8)<<"\t\t"<<c<<"\t"<<setw(20)<<book<<setw(20)<<q<<endl;
	}
			
	infile.close();
}		
	
		
class Inventory
{
	private:
		string stock_book;
		int stock_code;
		int stock_quantity;
		Order *addOrder;
		Order *cancelOrder;
		
	public:
		Inventory();
		Inventory(string ,int ,int);
		void setAddOrder(Order *);
		void setCancelOrder(Order *);
		void printInventory(int [] ,string [], int [],
							int [] ,string [], int [], 
							int [] ,string [], int [], 
							int , int );
};

Inventory::Inventory()
{
	stock_book = "";
	stock_code = 0;
	stock_quantity = 0;
	addOrder = NULL;
	cancelOrder = NULL;
}
		
Inventory::Inventory(string a,int b,int c)
{
	stock_book=a;
	stock_code=b;
	stock_quantity=c;
}
		
void Inventory::setAddOrder(Order *addord)
{
	addOrder = addord;
}
		
void Inventory::setCancelOrder(Order *cancord)
{
	cancelOrder = cancord;
}
		
void Inventory::printInventory(int stock_code[] ,string stock_book [], int stock_quantity [],
							   int order_code[] ,string order_book [], int order_quantity [], 
							   int cancel_code[] ,string cancel_book [], int cancel_quantity [], 
							   int ord, int ccl)
{
	ifstream in;
	ifstream in2;
	ifstream in3;
	ofstream out;
	in.open("stock.txt");
	in2.open("Order.txt");
	in3.open("Cancel.txt");
	out.open("InventoryFile.txt", ios::app);
			
	for(int i = 0; i<r; i++)
	{
		in>>stock_book[i]>>stock_code[i]>>stock_quantity[i];
	}		
	for(int i = 0; i<ord; i++)
	{
		in2>>order_code[i]>>order_book[i]>>order_quantity[i];
	}
	for(int i = 0; i<ccl; i++)
	{
		in3>>cancel_code[i]>>cancel_book[i]>>cancel_quantity[i];
	}
			
	for(int i = 0; i<r; i++)
	{
		for(int j = 0; j<ord; j++)
		{
			if(stock_code[i]==order_code[j])
			{
				stock_quantity[i] = stock_quantity[i] - order_quantity[j];
			}
			else
			{
				stock_quantity[i];
			}
		}
	}
			
	for(int i = 0; i<r; i++)
	{
		for(int j = 0; j<ccl; j++)
		{
			if(stock_code[i]==cancel_code[j])
			{
				stock_quantity[i] = stock_quantity[i] + cancel_quantity[j];
			}
			else
			{
				stock_quantity[i];
			}
		}
		out<<right << setw(10)<<stock_code[i]<<setw(28)<<stock_book[i]<<setw(33)<<stock_quantity[i]<<endl;
	}
			
	out << "_________________________________________________________________________________________" << endl;
			
	in.close();
	in2.close();
	in3.close();
	out.close();
}


class Person
{
	protected:
		string name;
		string emailAdd;
		string password;
		string address;
		string phone;
		
	public:
		Person(string = "", string = "");
		void registr();
		string getName() const;
		void displayOut(const Person *);
		friend istream &operator >> (istream &, Person &);
		virtual void display();
};

Person::Person(string b, string c)
{
	name = "";
	emailAdd = "";
	password = "";
	address = b;
	phone = c;
}
		
void Person::registr()
{
	system("cls");
	cout<<"\t\t\t\t\t_______________________________\n\n"
		<<setw(60) << " Create An Account \n"
		<<"\t\t\t\t\t_______________________________\n\n";
	cout<<setw(54)<< "Username : ";
	cin>>name;
	cout<<setw(54)<< "Password : ";
	cin>>password;
	cout<<setw(54)<< "Email Address : ";
	cin>>emailAdd;
			
			
	ofstream out("database.txt",ios::app);
	out<<endl<< setw(15)<<name<<setw(15)<<password<<setw(17)<<emailAdd<<endl;
	out.close();
	cout<<endl<<setw(65)<<"Registration is successfully\n\n";
}
		
string Person::getName() const
{
	return name;
}	
	
void Person::displayOut(const Person *p)
{
	ofstream out;
	out.open("InventoryFile.txt", ios::app);
	out<<right<<setw(43)<<"NAME: "<<name<<endl
		<<setw(43)<<"EMAIL ADDRESS: "<<emailAdd<<endl
		<<setw(43)<<"ADDRESS: "<<p->address<<endl
		<<setw(43)<<"PHONE NUMBER: "<<p->phone<<endl;
			
	out.close();
}
		
istream &operator >> (istream &input, Person &p)
{
	system("cls");
	
	int exist;
	cout << endl << setw(64) <<"===== Login =====" << endl << endl;
	cout << setw(58) <<"User Name     : ";
	input>>p.name;
	cout << setw(58) <<"Email address : ";
	input >> p.emailAdd;
	cout << setw(58) <<"Password      : ";
	input >> p.password;

			
	ifstream in("database.txt");
	string user,pass,email;
			
	while(in>>user>>pass>>email)
	{
		if(user==p.name && pass==p.password && email==p.emailAdd)
		{
			exist=1;
		}
	}
			
	in.close();
			
	if(exist==1)
	{
		system("cls");
		cout<<endl << setw(10)<< "Welcome "<<p.name << " to\n\n\n"
		 			    <<  "              ########         ##############    ####           ####         ########         ##            ##"   << endl
		 				<<  "             ##      ##                    ##    ##   #       #   ##        ##      ##        ##            ##" << endl
		 			    <<  "            ##        ##                 ##      ##     #    #    ##       ##        ##       ##            ##" << endl
		 				<<  "           ##############             ##         ##      ####     ##      ##############      ##            ##"  << endl
		 				<<  "          ##            ##         ##            ##               ##     ##            ##     ##            ##" <<endl
		 				<<  "         ##              ##     ##               ##               ##    ##              ##    ##            ##" << endl
		 				<<  "        ##                ##   ##############    ##               ##   ##                ##   ##########    ##########" << endl
						<< "\n\n\n" << endl;
	}
    else
	{
		cout << endl << setw(204)<<"Sorry, username, password or email address is invalid." << endl << setw(68)<<"Exit and try again..." << endl;
		exit(0);
	}
}
void Person::display()	
{
	cout<<"Name: "<<name<<endl;
}	

		
class Buyer: public Person
{
	private:
		string ic;
		Order *ord;
		
	public:
		Buyer(string ="",string ="",string = "");
		void placeAddOrder(Order *);
		void placeCancelOrder(Order *);
		void shownMenu();
		void display();
};

Buyer::Buyer(string ic,string add,string p)
{
	this->ic=ic;	
}

void Buyer::placeAddOrder(Order *Add)
{
	ord=Add;	
}
		
void Buyer::placeCancelOrder(Order *Cancle)
{
	ord=Cancle;
}

void Buyer::shownMenu()
{
	ord->menu();
}
void Buyer::display()
{
	cout<<"\t\t\t     Please enjoy the online shopping. The stocks are in high quality. "<<endl;
}

class Seller: public Person
{
		private:
		string compId;
		Inventory inv;
		
	public:
		Seller(string = "", string = "", string = "");
		void displayout(int ord, int ccl);
};

Seller::Seller(string a, string b , string c) : Person(b, c)
{
	compId = a;
}
		
void Seller::displayout(int ord, int ccl)
{	
	ofstream out;
	out.open("InventoryFile.txt", ios::app);
			
	out << "\t\t\t\t\t  COMPANY REGISTER ID: " << compId << endl << endl
		<< "_________________________________________________________________________________________" << endl << endl
 		<< "	  Code				    Stock                                 Quantity" << endl
		<< "_________________________________________________________________________________________" << endl << endl;
			
	string b[r];
	int a[r],c[r];
	string n[ord];
	int o[ord],d[ord];
	string nm[ccl];
	int e[ccl], g[ccl];
	inv.printInventory(a,b,c,o,n,d,e,nm,g, ord, ccl);
					
	out.close();
}
		

int main()
{
	Person *per=new Person;
	Buyer b;
	Order *ord;
	Order *cancel;

	string choice;
	
	L1:			 
		cout<<right<<setw(66)<<"===== MENU ====="<< endl << endl
			<<right<<setw(65)<<"Login -> 1\n"
			<<right<<setw(65)<<"Register -> 2\n"
			<<right<<setw(65)<<"Exit -> 3\n"
			<<setw(76)<<"________________________________\n\n"
			<<"\t\t\t\t\t    Please enter your choice : ";
		cin>>choice;
		
		if(choice=="1")
		{
			system("cls");
			cin>> *per;
			goto W;
		}
		else if(choice=="2")
		{
			per->registr();
			goto L1;
		}
		else if(choice=="3")
		{
			cout<<endl<<setw(84)<<"*********************************************"<<endl
					<<setw(84)<<"*                                           *"<<endl
					<<setw(84)<<"*     Thank you for using our service =)    *" << endl
					<<setw(84)<<"*                                           *"<<endl
					<<setw(84)<<"*********************************************"<<endl;
			exit(0);
		}
		else
		{
			cout<<endl<<setw(69)<<"Invalid choice...\n" <<setw(69)<< "Input again...\n\n";
			goto L1;
		}
		
	
	
	W:
		char decision;
		cout << setw(72) <<"===== Character =====" << endl << endl
		 	 << setw(68)<< "Buyer  -> B " << endl
		     << setw(67)<< "Seller -> S" << endl
		     << setw(78)<<"_________________________________" << endl << endl
		     << setw(76) << "Please enter your character: ";
		cin >> decision;
		
		int MenuChoice;
		
		if(decision=='B'||decision=='b')
		{
			system("cls");
			
			cout<<endl<<endl;
			
			string add, ic;
			string p;
			
			cout<< setw(62)<<"===== Welcome " << per->getName() << " =====" << endl << endl;
			cout<<setw(62)<<"NRIC            : ";
			cin>>ic;
			cin.ignore();
			
			cout<<setw(62)<<"Shipping Address: ";
			getline(cin,add);
			cout<<setw(62)<<"Phone number    : ";
			cin>>p;
			
			Buyer buy(ic,add,p);
			
			D:
			system("cls");
			
			cout <<endl<<setw(68)<<  "===== List ===== "<<endl << endl
			 	 <<setw(69)<<"Purchase Items   -> 1"<< endl
			 	 <<setw(69)<<"Cancel Items     -> 2" << endl
			 	 <<setw(69)<<"View List        -> 3" << endl
			 	 <<setw(69)<<"Quit the program -> 4" << endl
			 	 <<setw(71)<<"_________________________" << endl << endl
			 	 <<setw(71)<<"Please enter your choice: ";
			cin>>MenuChoice;
			
			string book[5]={"Korean_Language","Japanese_Language","Chinese_Language","French_Language","Arabic_Language"};
			int num = -1;
			switch(MenuChoice){	
			
			case 1:
					system("cls");
					
					per=&b;
					per.display();
					
					cout<<endl << setw(74) << "===== Purchase Items =====\n" << endl;
					buy.shownMenu();
					char sym;
					
					D0:
					cout<<"\n\n\t\t\t\t\t Buy the books ? (yes -> y, no -> n): ";
					cin>>sym;
					
					if(sym=='n'||sym=='N')
					{
						goto D;
					}
					while(sym=='y'||sym=='Y')
					{
						++num;
						int co,qu;
						string str1="The book you choose is ";
						cout<<"\n\t\t\t\t    Enter the codes of books you wish to buy : ";
						cin>>co;
				
						switch(co)
						{
							case 1001: cout<<right<<setw(64)<<str1<<book[0]<<". "<<endl;
										break;
							case 1002: cout<<right<<setw(63)<<str1<<book[1]<<". "<<endl;
										break;
							case 1003: cout<<right<<setw(64)<<str1<<book[2]<<". "<<endl;
										break;
							case 1004: cout<<right<<setw(64)<<str1<<book[3]<<". "<<endl;
										break;
							case 1005: cout<<right<<setw(64)<<str1<<book[4]<<". "<<endl;
										break;
								
							default: cout<<right<<setw(64)<<"Please enter the correct code.";
							 			goto A;
							 			break;
						}
						cout<<setw(66)<<"Enter quantity : ";
						cin>>qu;
						ord = new Order(book[co-1001],co,qu);
						buy.placeAddOrder(ord);
						ord->setOrderIC(ic);
						ord->printOrder("Order.txt");
						
						A:
						cout<<endl
							<<"\t\t#######################################################################################"<< endl
							<<"\n\n\t\t\t\t\t   Continue buying ? (yes=y,no=n): ";
						cin>>sym;
					}
					if(sym=='N'||sym=='n')
					{
					CHOOSEAGAIN:	
						char SYM;
						cout<<setw(87)<<"Would you like to view your order list? (yes=y,no=n): "<<endl;
						cin>>SYM;
					
						if(SYM=='y'||SYM=='Y')
						{
							ord->viewOrder();
						}
						
						else if(SYM=='n'||SYM=='N')
						goto D;
						
						else
						{
							cout<<setw(50)<<"**ERROR ERROR**"<<endl;
							cout<<setw(58)<<"Please enter correct alphabet"<<endl;
							goto CHOOSEAGAIN;
						}
					}
	
					else
					{
						cout<<"\n\n\t\t\t\tPlease enter the correct alphabet."<<endl;
						goto D0;
					}
					
					break;
					
			case 2:
					system("cls");
					cout<< "\t\t\t\t\t\t===== Cancle Items =====\n" << endl;
					buy.shownMenu();
					
					D1:
					cout<<"\n\n\t\t\t\tCancel the books ? (yes=y,no=n): ";
					cin>>sym;
					
					if(sym=='n'||sym=='N')
					{
						goto D;
					}
					while(sym=='y'||sym=='Y')
					{
						int Co,Qu;
						string str2="\t\t\t\tThe book you cancel is ";
						cout<<"\n\t\t\t\tEnter the codes of books you wish to cancle : ";
						cin>>Co;
				
						switch(Co)
						{
							case 1001: cout<<str2<<book[0]<<". "<<endl;
										break;
							case 1002: cout<<str2<<book[1]<<". "<<endl;
										break;
							case 1003: cout<<str2<<book[2]<<". "<<endl;
										break;
							case 1004: cout<<str2<<book[3]<<". "<<endl;
										break;
							case 1005: cout<<str2<<book[4]<<". "<<endl;
										break;
								
							default: cout<<"\t\t\t\tPlease enter the correct code.";
							 			goto B;
							 			break;
						}
						cout<<"\t\t\t\tEnter quantity : ";
						cin>>Qu;
						cancel = new Order(book[Co-1001],Co,Qu);
						buy.placeCancelOrder(cancel);
						cancel->setOrderIC(ic);
						cancel->printOrder("Cancel.txt");
						
						B:
						cout<<"\n\n\t\t\t\tContinue the cancellation ? (yes -> y, no -> n): ";
						cin>>sym;
					}
					if(sym=='N'||sym=='n')
					{
					ChooseAGAIN:	
						char Sym;
						cout<<"\t\t\t\tWould you like to view your list of cancelled items ? (yes=y,no=n): "<<endl;
						cin>>Sym;
					
						if(Sym=='y'||Sym=='Y')
						{
							cancel->viewCancel();
						}
						
						else if(Sym=='n'||Sym=='N')
						goto D;
						
						else
						{
							cout<<"\t\t\t\tPlease enter correct alphabet"<<endl;
							goto ChooseAGAIN;
						}
					}
					
					else
					{
						cout<<"\n\n\t\t\t\tPlease enter the correct alphabet."<<endl;
						goto D1;
					}
					
					
					break;
					
			case 3:
					system("cls");
					cout<<"\n\t\t\t\t===== View List =====\n";
					
					int number;
					Z:
					cout<<"\n\t\t\tChoose file type (Order list -> 1, Cancel list -> 2): ";
					cin>>number;
					
					if(number==1)
					{
						cout<<"\t\t\tYour order list is printed."<<endl
							<<"\t\t\tYou can view your printed order in a textfile named as (yourIC)Order"<<endl;
					}
					else if (number==2)
					{
						cout<<"\t\t\tYour list of cancelled item is printed."<<endl
							<<"\t\t\tYou can view your printed list of cancelled item in a textfile named as (yourIC)Cancel"<<endl;
					}	
					else
					{
						cout <<endl<< "\t\t\tPlease enter the correct number..." << endl;
						goto Z;
					}
					break;
					
			case 4:
					system("cls");
					cout<< "\t\t\t\tYou have successfully exit from the system." << endl;
					break;
					
			default :
					system("cls"); 
					cout<<"\n\n\t\t\t\tError input\n";
			}
		}
		else if (decision=='S'||decision=='s')
		{
			int choice;
			string id, compphone, compaddress;
			
			system("cls");
			
			cout<< endl << setw(60)<<"===== Welcome " << per->getName() << " =====" << endl << endl
				<<setw(59)<< "Enter your company ID: ";
			cin >> id;
			cout <<setw(59)<<"Company Address      : ";
			cin.ignore();
			getline(cin, compaddress);
			cout <<setw(59)<<"Company Phone number : ";
			cin >> compphone;
			Seller seller(id, compaddress, compphone);
			
			system("cls");
			
			C:
			cout <<setw(66)<< " ===== List ===== "<<endl
				 <<setw(68)<<"View Inventory   -> 1"<< endl
			 	 <<setw(68)<<"Quit the program -> 2" << endl
			 	 <<setw(70)<< "_________________________" << endl << endl
			 	 <<setw(70)<< "Please enter your choice: ";
			cin >> choice;
			
			if(choice == 1)
			{
				Inventory inv[5] = {Inventory("Korean Language", 1001, 1000),
							  		Inventory("Japanese Language", 1002, 1000),
							  		Inventory("Chinese Language", 1003, 1000),
									Inventory("French Language", 1004, 1000),
									Inventory("Arabic Language", 1005, 1000)};
				
				string stk;
				int cd, qt, m = 0, c = 0;
				
				ofstream out;
				out.open("InventoryFile.txt");
				
				cout << endl << "\t\t\tView your inventory in the output file named = InventoryFile.txt" << endl;
				
				out << "#######  ##     #  #         #  ########  ##	 #  #######  #######  #######  #     #" << endl
			   		<< "   #	 # #    #   #       #   #		  # #	 # 	   #	 #     #  #     #	#   #" << endl
			   		<< "   #	 #  #   #    #     #    ######	  #  #	 #     #     #     #  #######	 # #" << endl
			   		<< "   #     #   #  #     #   #     #		  #   #	 #     #     #     #  # #         #" << endl
			    	<< "   #     #    # #      # #      #	      #    # #     #     #     #  #   #	      #" << endl
					<< "#######  #     ##       #       ########  #     ##     #     #######  #     #     #" << endl << endl
					<< "=========================================================================================" << endl << endl;
				
				ifstream ordfile("Order.txt");
				if(!ordfile)
				{
					cout << endl << "There is no purchase order received..." << endl;
				}
				
				ifstream cclfile("Cancel.txt");
				if(!cclfile)
				{
					cout << endl << "There is no cancel order received..." << endl;
				}
				
				while(ordfile >> cd)
				{
					ordfile >> stk >> qt;
					ord = new Order(stk, cd, qt);
					if(cd == 1001)
					{
						inv[0].setAddOrder(ord);
					}
					else if(cd == 1002)
					{
						inv[1].setAddOrder(ord);
					}
					else if(cd == 1003)
					{
						inv[2].setAddOrder(ord);
					}
					else if(cd == 1004)
					{
						inv[3].setAddOrder(ord);
					}
					else if(cd == 1005)
					{
						inv[4].setAddOrder(ord);
					}
					m++;
				}
				
				while(cclfile >> cd)
				{
					cclfile >> stk >> qt;
					cancel = new Order(stk, cd, qt);
					if(cd == 1001)
					{
						inv[0].setCancelOrder(cancel);
					}
					else if(cd == 1002)
					{
						inv[1].setCancelOrder(cancel);
					}
					else if(cd == 1003)
					{
						inv[2].setCancelOrder(cancel);
					}
					else if(cd == 1004)
					{
						inv[3].setCancelOrder(cancel);
					}
					else if(cd == 1005)
					{
						inv[4].setCancelOrder(cancel);
					}c++;
				}
				
				per->displayOut(&seller);
				seller.displayout(m, c);
				ordfile.close();
				cclfile.close();
				out.close();
				
				
			}
			else if(choice == 2)
			{
				system("cls");
				cout<<setw(84)<<"*********************************************"<<endl
					<<setw(84)<<"*                                           *"<<endl
					<<setw(84)<<"*You have successfully exit from the system.*" << endl
					<<setw(84)<<"*                                           *"<<endl
					<<setw(84)<<"*********************************************"<<endl;
				exit(0);
			}
			else
			{
				cout << "Please input the correct choices listed." << endl;
					goto C;
			}
		}
		else
		{
			cout <<  "\nPlease choose the correct alphabet. Thank You!\n\n"<<endl;
			goto W;
		}
		
		return 0; 
}


