Question: In c# console application 1. Create an abstract class called Sandwiches that has a sandwich name, type, price and number of ordered sandwiches. It also

 In c# console application 1. Create an abstract class called "Sandwiches"

In c# console application

1. Create an abstract class called "Sandwiches" that has a sandwich name, type, price and number of ordered sandwiches. It also has respective auto-implemented properties for all fields apart from the price, where its property checks whether the assigned value is positive or not. Ifa negative number is assigned as a price, the program should display a warning message. The class also contains a method called "GetSandwichInfo" that displays the name and type of the sandwich. Moreover, the class implements an interface called "IBuyable" that has a method called "CalculatePrice" and accept two parameters, a sandwich price and number of sandwiches. 2. Create a child class called "Signature Sandwiches" that has a constructor that requires passing all fields (name, type, price and number of sandwiches ordered), and an implementation of the abstract method it inherits. 3. In the Main method, instantiate two objects from the "Signature Sandwiches" class and invokethe "GetSandwichInfo" and "CalculatePrice" methods by passing the appropriate list of parameters. Sample output : Sandwich ordered is Meat Based and its name is Cheese Burger Total Price is 13.50 Once finished, upload a .txt file that contains your solution. B A A U S X, X va 9 IX

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!