Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
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 CS 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: or for Celsius and or 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 or 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 or "Hot" if the converted temperature is between to or to "Mild" if the converted temperature is between to : or to "Cool" if the converted temperature is between to or to "Cold" if the converted temperature is between to or to "Freezing" if the converted temperature is less than or equal to or For example, one run might look as follows: Enter a unit of measurement for the temperature: C Enter a temperature: The temperature in Celsius is equivalent to in Fahrenheit The weather is: Mild As part of your answer, include a subfunction, called FahrenheitToCelcius, that takes one pa rameter and converts a temperature to Celcius. Include another subfunction, called CelciusTo Fahrenheit, that takes one parameter and converts a temperature to Fahrenheit. Include another subfunction, called WeatherClassifier that takes two parameters and classifies the converted tem perature according to the abovementioned ranges, and prints out the appropriate class label. For converting Celsius to Fahrenheit: For converting Fahrenheit to Celsius: Question: Mark What type of functions are FahrenheitToCelsius, CelciusToFahrenheit, and WeatherClassifier? Ex plain your answer.
Using only the techniques and methods taught in CS 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:
or for Celsius and or 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 or 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 or
"Hot" if the converted temperature is between to or to
"Mild" if the converted temperature is between to : or to
"Cool" if the converted temperature is between to or to
"Cold" if the converted temperature is between to or to
"Freezing" if the converted temperature is less than or equal to or
For example, one run might look as follows:
Enter a unit of measurement for the temperature: C
Enter a temperature:
The temperature in Celsius is equivalent to in Fahrenheit
The weather is: Mild
As part of your answer, include a subfunction, called FahrenheitToCelcius, that takes one pa
rameter and converts a temperature to Celcius. Include another subfunction, called CelciusTo
Fahrenheit, that takes one parameter and converts a temperature to Fahrenheit. Include another
subfunction, called WeatherClassifier that takes two parameters and classifies the converted tem
perature according to the abovementioned ranges, and prints out the appropriate class label.
For converting Celsius to Fahrenheit:
For converting Fahrenheit to Celsius:
Question: Mark
What type of functions are FahrenheitToCelsius, CelciusToFahrenheit, and WeatherClassifier? Ex
plain your answer.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started