Question: C++ question! Write a function that takes a temperature in Kelvin as input and returns that temperature in Fahrenheit and Celsius. Since any function can

C++ question!

Write a function that takes a temperature in Kelvin as input and returns that temperature in Fahrenheit and Celsius. Since any function can have only one return value, your function will return the second temperature using a call by reference formal parameter.

- Your function must have the name tempconvertor (NOTE THE SPELLING)

- Your function must have two formal parameters, each of type double

- The first parameter is the temperature in Kelvin and must be passed by value

- The second parameter is the temperature in Celsius and must be passed by reference

- The return type for your function must be double

- The return value for your function must be the temperature in Fahrenheit

- Since zero Kelvin is the lowest possible temperature, your function must set both the Celsius and Fahrenheit temperatures to -1000 for a Kelvin temperature less than zero

- For all Kelvin temperatures greater than or equal to zero, your function must convert the Kelvin temperature to Celsius and Fahrenheit using the following equations

Celsius = Kelvin 273.15

Fahrenheit = Kelvin X (9/5) 459.67

*DO NOT CHANGE THE PROTOTYPE GIVEN*

Prototype: double tempconvertor(double, double&);

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!