Question: Using only the techniques and methods taught in CS 1 1 0 , write a C + + program that acts as a temperature converter

Using only the techniques and methods taught in CS110, write a C++ program that acts as a temperature converter and weather classifier. The program must prompt the user to choose a unit of measurement for the temperature by typing in the letter corresponding to the desired unit: c or C for Celsius and f or F for Fahrenheit. If the user types a different letter, the program should display an error message and exits. After selecting the desired unit, the program should prompt the user to enter a temperature in the selected unit, and convert it to the opposite unit: if the user selects c or C then the program must convert the entered temperature to Fahrenheit, and if the user selects f or F then the program must convert the entered temperature to Celsius. After converting the temperature, the program must classify it according to the following six categories, and display the appropriate class label: Humid if the converted temperature is greater than 35\deg C, or 95\deg F Hot if the converted temperature is between (29\deg C to 35\deg C], or (85\deg F to 95\deg F] Mild if the converted temperature is between (18\deg C to 29\deg C], or (65\deg F to 85\deg F] Cool if the converted temperature is between (9\deg C to 18\deg C], or (49\deg F to 65\deg F] Cold if the converted temperature is between (0\deg C to 9\deg C], or (32\deg F to 49\deg F] Freezing if the converted temperature is less than or equal to 0\deg C, or 32\deg FFor example, one run might look as follows:Enter a unit of measurement for the temperature: CEnter a temperature: 20The temperature 20 in Celsius is equivalent to 68 in Fahrenheit The weather is: MildAs part of your answer, include a sub-function, called FahrenheitToCelcius, that takes one pa- rameter and converts a temperature to Celcius. Include another sub-function, called CelciusTo- Fahrenheit, that takes one parameter and converts a temperature to Fahrenheit. Include another sub-function, called WeatherClassifier that takes two parameters and classifies the converted tem- perature according to the above-mentioned ranges, and prints out the appropriate class label.

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!