Complete the following tasks: a. Design a method that calculates the cost of boarding a horse at
Question:
Complete the following tasks:
a. Design a method that calculates the cost of boarding a horse at Delmar Stables. The method accepts a code for the type of boarding, S for self-care, which provides just shelter and costs $200 per month, or F for full service, which provides all care, including feeding and grooming, and costs $700 per month. The method should throw an exception if the boarding code is invalid.
b. Write a method that calls the module designed in Exercise 10a. If the method throws an exception, force the price of boarding to 0.
c. Write a method that calls the method designed in Exercise 10a. If the method throws an exception, require the user to reenter the code.
d. Write a method that calls the method designed in Exercise 10a. If the method throws an exception, force the location code to F and the price to $700.
Step by Step Answer: