Answer to Question #17606 in C# for Zainab
You will need the following for the program implementation.
1. A public class called Pizza with the following:
• A public attribute, of string type, called TypeofPizza. This attribute will hold four values (Vegetable, Margarita, Pepperoni, Napolitano).
• A public attribute, of char type, called SizeofPizza. This attribute will hold three values (S, M, and L), where S for Small, M for Medium, and L for Large.
• A method called CalculPrice to compute the price of the pizza, using the list prices below:
2. A main( ) method in the client class with following tasks:
• Declare an object called MyPizza of type Pizza class.
• Print the following messages for the user:
o “Please select yourpizza:”
o “1. Pizza Margarita”
o “2. Pizza Pepperoni”
o “3. Pizza Napolitano”
o “4. Pizza Vegetable”
• Read the pizza correspondent number and save it in a suitable declared variable.
• Print a message the asks the user to enter the pizza size
• Read the pizza size and save it in a suitable declared variable.
• Compute the price of the entered pizza by calling the method CalculPrice.
• Print a message that contains the name, the size and the price of the pizza.
Submit it with all requirements as an assignment to our control panel and we'll assist you.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!