Question: Add code to the tempCheck ( ) method shown below: 1 . If the temperature is greater than the constant LIMIT that they've set of

Add code to the tempCheck() method shown below:
1. If the temperature is greater than the constant LIMIT that they've set of 32, it throws a TemperatureTooHigh exception with two parameters passed to it to use its overload constructor: getString() and LIMIT.
2. tempCheck should return false if it throws the TemperatureTooHigh exception
3. Otherwise, tempCheck should return true
the code provided is:
public Boolean tempCheck() throws TemperatureTooHigh {
boolean tempOK = false;
modify this code according to instructions and show final code in Java

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!