This is my first C++ class and I stuck on the first assignment.
this is the assignment:
"The formula to convert Fahrenheit to Centigrade is: c = 5/9 * (f – 32)
There is also an approximation of the conversion given by taking half the Fahrenheit temperature and subtracting 15. You want to do it both ways and determine how good of an approximation this is.
Write a C++ program that prompts the user for a temperature in Fahrenheit, computes the centigrade equivalent using the actual formula, computes the approximation, and computes the percent difference between the two.
Your program must check that the Fahrenheit temperature is in the range:
-30 <= F <= 120
If the Fahrenheit temperature is not within this range, print out an appropriate message and terminate the program.
Input: Temperature in Fahrenheit
Output:
1. Temperature in Fahrenheit
2. Actual temperature in centigrade using (c = 5/9 * (f – 32) )
3. approximated temperature in centigrade
4. percent difference between the approximation and the actual temperature."
Can some please show exactly how I would type in that calculation?
Thanks Leon