Question: Write a console application in C# that calculates the slices of pizza each person can eat. Your program should ask the user to enter the

Write a console application in C# that calculates the slices of pizza each person can eat. Your program should ask the user to enter the total number of slices of pizza that are available to eat and the number of people that will be eating. Then calculate the number of slices each person will be able to eat assuming each person eats the same amount and display the output. Program Requirements:

Create a separate method to calculate the number of slices per person. Remember if youre using a console application your method will need to start with private static instead of just private. This method should have 2 parameters, one for total slices, another for number of people.

Handle inputs so that if a text value is entered, alert the user that the input is not valid

Use a try / catch block to ensure that if the user enters 0 for the number of people an exception isnt thrown for dividing by 0.

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!