Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions

Question

=+working on a micro-multinational?

Answered: 1 week ago

Question

=+j Identify the challenges of training an international workforce.

Answered: 1 week ago