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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started