Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions