12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
//Restaurant Manager Table-2 #include<iostream.h> #include<fstream.h> #include<conio.h> #include<windows.h> using namespace std; class table{ public: void menu() { ifstream menu; menu.open("menu.txt"); string STRING; string inFile_contents; string previousLine=""; while(!menu.eof()) { getline(menu,STRING); // Saves the line in STRING. if (STRING != previousLine) { previousLine=STRING; cout<<STRING<<endl; // Prints our STRING. } } menu.close(); } void order() {int tno=2; char ordr[100]; cout<<"\n\nPlease enter the food codes\n"; cout<<"(Eg:like f2,d1,c3)\n"; ofstream outfile; outfile.open("Order2.txt"); cin.getline(ordr,100); outfile <<"TableNo: "<< tno <<endl << ordr <<endl; outfile.close(); cout<<"."; Sleep(800); cout<<"."; Sleep(800); cout<<"."; Sleep(1000); cout<<"Your order has been placed\n"; } }c; int main() { char x; c.menu(); c.order(); getch(); }