Java: Initializing error for temperature Celsius to Fahrenheit
I keep getting an initializing error for fdeg. Im trying just to show a
table that converts Celsius to Fahrenheit.
my code:
public class TempTable
{
public static void main(String[] args)
{
double cdeg;
double fdeg;
System.out.println("Fahrenheit" +"\t" + "Celsius");
System.out.println("-------------------------");
for ( cdeg = 0; fdeg <= 20; cdeg++)
{
fdeg = 1.8 * cdeg + 32;
System.out.printf( " %3d C = %5.1f F\n", cdeg, fdeg );
}
}
}
No comments:
Post a Comment