Question: 6. Solution must be in C# ArgumentException is an existing class that derives from Exception; you use it when one or more of a methods

6. Solution must be in C#

ArgumentException is an existing class that derives from Exception; you use it when one or more of a methods arguments do not fall within an expected range. Write the application SwimmingWaterTemperature containing a variable that can hold a temperature expressed in degrees Fahrenheit. Within the class, create a method that accepts a parameter for a water temperature and returns true or false, indicating whether the water temperature is between 70 and 85 degrees and thus comfortable for swimming. If the temperature is not between 32 and 212 (the freezing and boiling points of water), it is invalid, and the method should throw an ArgumentException. In the Main() method, continuously prompt the user for data temperature, pass it to the method, and then display the following messages indicating whether the temperature is comfortable, not comfortable, or invalid:

X degrees is comfortable for swimming.

X degrees is not comfortable for swimming.

Value does not fall within the expected range.

6. Solution must be in C# ArgumentException is an existing class that

SwimmingWaterTemperature.cs+ 1 sing Systern; 2 using static System.Console; 3 class SwimmingwaterTemperature 4 5 static void Main) 7 // Your code here 9 10 public static boolean CheckComfort(int temp) // your logic here 12 13

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!