Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
VirtualResto
//g++ 7.4.0 //Virtual Resto // This code is created by Rezaul Hoque on April 30,2021 //please contact at jewelmrh@yahoo.com #include <iostream> using namespace std; //This class is the Abstract Data Type with three pure virtual functions,which will be overridden in the subsequent derived classes class EatOut{ public: virtual void greeting()=0; virtual void menu()=0; virtual void cost() =0; virtual void thankYou()=0; }; void EatOut::thankYou(){ cout<<"Thank you for choosing us.\n";}//implementation of pure virtual function in ADT, rare case, in order to provide common feature in all the subsequent overridden functions class Breakfast : public EatOut{ public: void greeting() { cout<<"Good morning.\n";} void menu() { cout<<"To kick start your day we are offering:\n"; cout<<" lemonade(1 glass), rumali roti(2 pieces), dal bhuna(1 cup), vegetable stew(1 cup) and chaï( 1 cup).\n"; } void cost() { cout <<" The Breakfast package costs Tk 50.\n"; } void thankYou(){ cout<<"Hope you like our breakfast.\n"; EatOut::thankYou(); } }; class Lunch : public EatOut{ public: void greeting() { cout<<"Good afternoon.\n";} void menu() { cout<<"Our lunch menu for one can easily satisfies two people and we are offering:\n"; cout<<" coke(1 glass), shorshe shak(1 plate), rice (2 plates), lentil soup(1 cup), shol fish dopeyaja(1 cup) and kheer( 1 cup).\n"; } void cost() { cout <<" The lunch package costs Tk 90.\n"; } void thankYou(){ cout<<"Dhonnobad.\n"; EatOut::thankYou(); } }; class Dinner : public EatOut{ public: void greeting() { cout<<"Good evening.\n";} void menu() { cout<<"We have the best dinner menu in the town and we are offering:\n"; cout<<" borhani(1 glass), moglaï parota(1 piece),salad(1 plate) and mishti doï( 1 cup).\n"; } void cost() { cout <<" The dinner package costs Tk 50.\n"; } void thankYou(){ cout<<"Bon appétit.\n"; EatOut::thankYou(); } }; int main() { Breakfast br; Lunch ln; Dinner din; cout<<" Virtual Resto!\n"; cout<<"****Breakfast****\n"; br.greeting(); br.menu(); br.cost(); br.thankYou(); cout<<"****Lunch****\n"; ln.greeting(); ln.menu(); ln.cost(); ln.thankYou(); cout<<"****Dinner****\n"; din.greeting(); din.menu(); din.cost(); din.thankYou(); return 0; }
run
|
edit
|
history
|
help
0
ახარისხება~ფინალური
Expected types
Roots of a Quadratic Equation
Test 10(2020)
Pac update
hey
A+B ორობით სისტემაში
Sangharsh vhawale
c++_array_size
replace_copy_if-30-Seconds-of-C++