Create an OOP program that can be used to represent and manage a resturaunt’s menu.
Different kinds of people need to interact with the menu in different ways:
Can you think of any other people who might want to interact with the menu? And how they might interact?
Before you start writing any code, draw a picture of your classes and how they interact. Are you making use of inheritance? What Objects contain other objects? You will be expected to be able to explain your class hierarchy so please take care.
If you are running linux then there’s a simple tool called dia
that is quite useful for these kinds of diagrams. sudo apt install dia
.
Then code up your class hierarchy. Note that at this point in the process there is no functionality exposed. There is no frontend or user interface. The only functions you have are constructors.
If you are doing this in JS then this program
Create the functionality that the resturaunt manager would need. This functionality should be developed in a TDD way.
The following functionality should be exposed:
This functionality will eventually be accessable through a user interface. Take some time to think abou that user interface. How would a manager want to interact with it? How will these functions get called? What information will be required at each point?
order_instance.add_item(???)
order_instance.remove_item(???)
order_instance.get_total_price()