Question: Please do this in c# A grocery list is provided below: Create three different classes named Milk, Bread, and Eggs, where each has the following
A grocery list is provided below: Create three different classes named Milk, Bread, and Eggs, where each has the following members private data member "unit_price private data member "quantity". Default and overloaded constructors Provide properties for the private data members public total_price method which returns the total price (e.g., unit_price times quantity) a ToString function similar to the example in Exercise 36 Create a class Grocery, which has the following member my_milk of type Milk my_bread of type Bread my_eggs of type Eggs An overloaded constructor which takes all the items above as inputs An expense method which calculates the total price of all items. This function must call the individual total_price methods reside in the classes Milk, Bread, and Eggs A ToString function Develop a driver main function to demonstrate all of the above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
