- #1
Teh
- 47
- 0
I am having difficulties understanding this program may someone help me please.
Using the CelsiusToKelvin function as a guide, create a new function, changing the name to KelvinToCelsius, and modifying the function accordingly.
output: main.cpp: In function ‘int main()’:
main.cpp:24:55: error: ‘KelvinToCelsius’ was not declared in this scope
Using the CelsiusToKelvin function as a guide, create a new function, changing the name to KelvinToCelsius, and modifying the function accordingly.
Code:
#include <iostream>
using namespace std;
double CelsiusToKelvin(double valueCelsius) {
double valueKelvin = 0.0;
valueKelvin = valueCelsius + 273.15;
return valueKelvin;
}
/* Your solution goes here */
/* ^ Your solution goes here ^ */
int main() {
double valueC = 0.0;
double valueK = 0.0;
valueC = 10.0;
cout << valueC << " C is " << CelsiusToKelvin(valueC) << " K" << endl;
valueK = 283.15;
cout << valueK << " is " << KelvinToCelsius(valueK) << " C" << endl;
return 0;
}
main.cpp:24:55: error: ‘KelvinToCelsius’ was not declared in this scope