Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (Pizza) (30 points) Create a C# static function named PizzaCost that calculates the cost of a pizza. It has 4 parameters representing the size

3. (Pizza) (30 points) Create a C# static function named PizzaCost that calculates the cost of a pizza. It has 4 parameters representing the size of the pizza (either small, medium, or large), the number of cheese toppings, the number of pepperoni toppings, and the number of ham toppings. It returns a double that is the cost of a pizza. The cost of a pizza is determined by:

? Small: $10 + $2 per topping

? Medium: $12 + $2 per topping

? Large: $14 + $2 per topping

For example, a large pizza with one cheese (1x$2), one pepperoni (1x$2) and two ham toppings (2x$2) should cost a total of $22. (i.e. $14+1x$2+1x$2+2x$2=$22) Create a C# static function named PizzaDescription that print the information of a pizza. It has 5 parameters representing the size of the pizza (either small, medium, or large), the number of cheese toppings, the number of pepperoni toppings, the number of ham toppings, and the total cost of a pizza. It prints the information of a pizza, including its size, the number and kind of each topping, and the cost. In the main method, call these two functions sequentially (i.e., call PizzaCost and then call PizzaDescription)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago