Question: (1)You write a method to convert a Fahrenheit temperature to degrees Celsius. Your code looks like this: double centigrade, fahrenheit; fahrenheit = 50.0; centigrade =

(1)You write a method to convert a Fahrenheit temperature to degrees Celsius. Your code looks like this:

double centigrade, fahrenheit;

fahrenheit = 50.0;

centigrade = (fahrenheit - 32)*(5/9) ;

The equation is correct, in a mathematical sense. The output is not exactly what you want.

Why is the output incorrect? Fix the code so that it works, and explain in detail why the version above does not work.

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!