77 309
Assignments Done
Successfully Done
In July 2019

Answer to Question #17606 in C# for Zainab

Question #17606
Write an object-oriented program in C# that takes a Pizza type and size as inputs. The program then should compute and print the price.

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:

10 AED
10 AED
15 AED
15 AED
14 AED
14 AED
19 AED
19 AED
18 AED
18 AED
23 AED
23 AED

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.
Expert's answer
Unfortunately, your question requires a lot of work and cannot be done for free.
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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions