ok another issue i'm not sure why this is happening... This is supposed to convert celsius to fahrenheit. The conversion rate is 9/5 * Celsius + 32.
When i enter that it never works. It always shouls 9/5 as 1.0 instead of 1.8 which it actually is. So this code works...
double fahr; //Fahrenheit output
int c; //Celsius counting integer
double calc = 1.8; //Calculation
System.out.println("Celsius Fahrenheit.");
System.out.println(".........................");
for (c=0; c<= 20; c++)
{
fahr = calc * c + 32;
System.out.printf(c + "\t\t" + "%.2f\n", fahr);
}
but this code does not...
double fahr; //Fahrenheit output
int c; //Celsius counting integer
System.out.println("Celsius Fahrenheit.");
System.out.println(".........................");
for (c=0; c<= 20; c++)
{
fahr = 9/5 * c + 32;
System.out.printf(c + "\t\t" + "%.2f\n", fahr);
}
WHY?