Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- Must be written in C# Programming Exercise 5 (pg. 538) Create a program named BookExceptionDemo for the Peterman Publishing Company Create a BookException class
- Must be written in C#
Programming Exercise 5 (pg. 538) Create a program named BookExceptionDemo for the Peterman Publishing Company Create a BookException class that is instantiated when a Book's price exceeds 10 cents per page and whose constructor requires three Create an error message that is passed to the Exception class constructor for the Message property when Book does not meet the price-to-pages ratio. For example, an error message might be arguments for title, price, and number of pages For Goodnight Moon, ratio is invalid. Price is S12.99 for 25 pages Create a Book class that contains fields for title, author, price, and number of pages. Include properties for each field. Throw a BookException if a client program tries to construct a Book object for which the price is more than 10 cents per page. Create a program that creates at least four Book objects-somewhere the ratio is acceptable, and others where it is not. Catch any thrown exceptions, and display the BookException Message Hint Sample Output GOSY CAWINDOWSlsystem321 cmd.exe ..Price is $12.99 for 25 pages. For The Grapes of Math, ratio is invalid ..Price is $30.99 for 300 pages. Press any key to continue . Your program should include your Full Name, Assignment Name, Date and description as a comment on the top of your application. Submit a zip that includes BookExceptionDemo project files. The project files should include Book class, BookException class and BookExceptionDemo class (includes the Main method)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