Question: (I have modified it somewhat but cannot get the code to ask for the other temperature measurments. It runs correctly but it asks for only
(I have modified it somewhat but cannot get the code to ask for the other temperature measurments. It runs correctly but it asks for only one temperature. Any help would be greatly appreciated.)
Modify Assingment 9 so that the calculations for temperature conversion are done within functions. For this assignment you will need three separate functions. They are as follows:
C2F - Converts Celsius to Fahrenheit.
K2F - Converts Kelvin to Fahrenheit
N2F - Converts Newtons to Fahrenheit
Each of the above functions should take as an argument a double value which holds the temperature to be converted. These functions should also return a double value which holds the value converted to Fahrenheit. You should only modify the solution for lab 9 to replace the temperature conversion formulas to function calls. Make sure that you name these functions as outlined above. Remember, 35% of your grade is for following the directions.
The following is required for your three functions
Input - Temperature to be converted
Process - Covert value to Fahrenheit using the appropriate equation
Output - Temperature converted to Fahrenheit

Code:
#include
using namespace std;
int main();
void C2F(double num, char type)
{
double F;
F = num * 9 / 5 + 32;
cout
cout
}
void K2F(double num, char type)
{
double F;
F = (num - 273.15) * 1.8 + 32;
cout
cout
}
void N2F(double num, char type)
{
double F;
F = num * 60 / 11 + 32;
cout
cout
}
int main()
{
double num;
char type;
cout
cout
cout
cout
cout
cout
cin >> num >> type;
switch (type)
{
case 'C':
C2F(num, type);
break;
case 'K':
K2F(num, type);
break;
case 'N':
N2F(num, type);
break;
case 'x':
{
return 1;
}
}
return 0;
}
Your program should run like the following CAWINDOWS system32\cmd.exe This temperature conversion program converts other temperature types to Fahrenhe it he temperature types are: -Celciu K- Kelvin - Newton - exit o use the converter you must input a value and one of the temparture types or example 32 C converts 32 degress from Celsius to Fahrenheit lease enter a value and it' s type to be converted 2 C 2C is 89.6 in Fahrenheit Please enter a value and it' s type to be converted 0 N GN is 141.091inFahrenheit lease enter a value and it' s type to be converted 8 K 8K is-427.27 in Fahrenheit Please enter a value and it's type to be converted ress any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
