Question: Create TooColdException and TooHotException Exceptions Design a class Customer with following characteristics. Member method: int giveCupOfCoffee ( int temperature ) The method should check whether

Create TooColdException and TooHotException Exceptions
Design a class Customer with
following characteristics.
Member method:
int giveCupOfCoffee(int
temperature)
The method should check
whether the coffee is too cold
or too hot.
The method throws
exception TooColdExceptio
n if coffee is cold (below 35).
The method throws
exception TooHotException
if coffee is overly hot (over
60).
Return 1 if coffee is at a
perfect temperature.
Input
30
Output

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!