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
Step: 1
Get Instant Access to Expert-Tailored 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