Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I only need the restaurant class and methods Your project should have these classes: MenuItem, Order, DeliveryOrder, and Restaurant. All data members of each class

I only need the restaurant class and methods
Your project should have these classes: MenuItem, Order, DeliveryOrder, and Restaurant. All data members of each class should be marked as private.
(i.e. Use data hiding.) This project should be broken down into a header file, implementation file and main file with the main function in it.
MenuItem :
A MenuItem object represents a menu item to be offered for sale at the restaurant.It has two data members :
a string for the item's name
a float for the item's price
(
how much the restaurant sells the item for
)
The Menu Item methods are :
constructor method
-
takes two parameters
(
name
,
price
)
and uses them to initialize the data members
get methods for each of the data members : getName
(
)
and getPrice
(
)
Order :
An Order object represents a single order on the app.It has two data members :
a name for the order
(
The person making the order.
)
a vector or array to hold the items ordered
a bool to determine if the order has been successfully completed
The Order methods are :
constructor method
-
takes one argument, the name for the order, and initializes the data members
get methods for each of the data members : getName
(
)
,
getItems
(
)
,
and getCompleted
(
)
a method that returns the total price of all items in the order
a method to mark the order as complete
DeliveryOrder :
Represents an order that needs to be delivered.Must have all of the same functionality of an Order object, but also include two more data members.
A string to hold the address for delivery.
A bool to represent if the order has been successfully delivered
Methods for DeliveryOrder should include...
A constructor that takes the same arguments as an Order object but also an address for delivery
A method to mark the order as delivered
Restaurant :
(
Remember that the Restaurant class must not directly access the private data members of MenuItem and Order
/
DeliveryOrder objects, but instead must call the appropriate get methods.
)
A Restaurant object represents a restaurant on a food delivery app.It has four data members :
a string for the name of the restaurant
a vector or array of MenuItem objects that constitutes the restaurant's menu
a vector or array of Order pointers submitted to the restaurant
(
This should hold both regular takeout Orders and DeliveryOrders.Think about polymorphism and if you need other functions to be virtual.
)
The Restaurant methods are :
constructor method
-
takes one parameter, a string for the name of the stand; initializes the name to that value
a get method for the name : getName
(
)
addMenuItem :
Takes as a parameter a MenuItem object and adds it to the menu
New items can be added to the menu whenever
makeOrder :
Takes at least two arguments.The first is the name for the order, the second is an array or vector of strings with the names of menu items that are to be added to the order.Only names that match items on that restaurant's menu should be added to the order. Remember, Order objects take MenuItem objects and not just the name.
makeDeliveryOrder :
Does all fo the same as makeOrder above, but also takes an address and creates the correct type of DeliveryOrder object and fills data members appropriately
markComplete :
Takes either an Order or a DeliveryOrder and marks the order as complete.
markDelivered :
Takes a DeliveryOrder and marks the order as delivered
totalRevenue :
Returns the total revenue derived from all orders over history at a restaurant that have been marked as complete
(
Ignore delivery, we'll call that Door Dash's problem.
)
displayMenu :
Should display the name of the restaurant and the menu items and prices available at that restaurant
displayUnfilledOrders :
Should display details for all orders yet to be marked as complete
(
Three beef all day chef!
)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions