Solution to A) Create a function called To_Celsius that takes in a temperature in Fahrenheit temperature and … - Sikademy
Author Image

Archangel Macsika

A) Create a function called To_Celsius that takes in a temperature in Fahrenheit temperature and returns the equivalent in Celsius. B) Create another function called To_Fahrenheit that takes in a temperature in Celsius and returns the equivalent in Fahrenheit. C) Use these functions to write a function called Print_EQ_Temps that prints out the Fahrenheit equivalents of all Celsius temperatures from 0°-100°, and the Celsius equivalents of all Fahrenheit temperatures from 32°-212°. Then, call this function in your program. Hint: Use for loops to input into your functions.

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


#include <iostream> #include <cmath> using namespace std; double To_Celsius(double fahrenheit){ return (fahrenheit - 32.0) * 5.0 / 9.0; } double To_Fahrenheit(double celsius){ return celsius * 9.0 / 5.0 + 32.0; } void Print_EQ_Temps(){ for(int i=0; i>=-100;i--){ cout<<i<<"C = "<<To_Fahrenheit(i)<<"F\n"; } cout<<"\n\n"; for(int i=32; i>=-212;i--){ cout<<i<<"F = "<<To_Celsius(i)<<"C\n"; } } int main() { Print_EQ_Temps(); system("pause"); return 0; }


Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1114-qpid-110