Java Assignment Help Tutorial
by Alice Portman Online marketing HeadDescription of RoastDinner Class
Methods
virtual int getPrice()=0;
virtual void getOrderDetails()=0;
virtual void printOrder()=0;
Read more about: Java Assignment Help
virtual void addExtraMeat() = 0;
virtual void addExtraSide() = 0;
these are pure virtual function that will be overrided by
the subclasses, to provide the behaviour according to the meal type
const char * getMeatName(char meatChar)
It takes a single
character as arguement and return the full name of meat.
const char *
getSideName(char sideChar)
It takes a single
character as arguement and return the full name of side.
Description of Medium Class
Methods
Medium()
It is the default
constructor
void getOrderDetails()
This method generates the menu for the order, if user wishes
to have a medium dinner
void printOrder()
This method is used to print the order details
int getPrice()
This method returns the price of the dinner
void addExtraMeat()
This method is used to add extra meat to the order
void addExtraSide()
This method is used to add extra side to the order
Description of Large Class
Methods
Large()
It is the default
constructor
void getOrderDetails()
This method generates the menu for the order, if user wishes
to have a large dinner
void printOrder()
This method is used to print the order details
int getPrice()
This method returns the price of the dinner
void addExtraMeat()
This method is used to add extra meat to the order
void addExtraSide()
This method is used to add extra side to the order
Read more
about: Assignment Help Australia
Description of XtraLarge Class
Methods
XtraLarge()
It is the default
constructor
void getOrderDetails()
This method generates the menu for the order, if user wishes
to have an extra large dinner
void printOrder()
This method is used to print the order details
int getPrice()
This method returns the price of the dinner
void addExtraMeat()
This method is used to add extra meat to the order
void addExtraSide()
This method is used to add extra side to the order
Read more
about Online Assignment Help
Main Method
In main function I have used polymorphism to store order
details. I have created a vector, in which I
have stored an object of the Medium,
Large or Extra large classes according to
user choice.
First of all I asked user to input his name and mobile
number after that I have an infinite loop that will break when the user
completes the order
In loop first I read
the choice dinner M, L, X then I created an object of the
appropriate class and called the class method to read order details. This
process continues till user order was not
completed.
After completion of order, I called the printOrder() method
in a loop that will print all order details.
Top
grade Assignment Help
provides affordable assignment writing services for students studying in
UG/PG/PhD courses. Top grade assignment help deals exclusively in technical
assignment help.
Our
main services include:
·
Web
Programming Assignment help
Sponsor Ads
Created on Sep 4th 2017 07:07. Viewed 467 times.