91.2k views
2 votes
Using the CelsiusTokelvin function as a guide, create a new function, changing the name to KelvinToCelsius, and modifying the function accordingly using namespoce std 4 double CelstusTokelvinÇdouble valueCelsius) ( 5 double valuekelvin -0.0; 7valuekelvin valueCelsius 273.15; 9 return vatuekelvin; 10 12 Your solution goes here 13 14 int main 15 double valueC 0.0; 16 double valuek-0.0 17 18 vatuec 18.0; Run

User JonnyRo
by
3.3k points

1 Answer

0 votes

Answer:

Please find the full code in the attached file.

Output:

10 C is 283.15 K

283.15 K is 10 C

Step-by-step explanation:

In this program to method "CelsiusToKelvin and KelvinToCelsius" is declared that takes a double variable as a parameter.

Both the above method defines a variable that converts the value in their respective value and converts and returns its value.

Inside the main method two double variables "valueC, valueK" is declared that hold value in and pass into the method and print its return value.

Using the CelsiusTokelvin function as a guide, create a new function, changing the-example-1
User Chad Gorshing
by
3.3k points