i figured to get back into the grove and learn somemore i should review first. so im creating a table of conversions from farenheit to celcius.(yes a table,yes i know thats not great
anyways i am not sure but when i try to run the program it shows the farenheit increasing, but the celcius always stays -0.0
here is the code
CODE
//converts Farenheit temp to celcius
class TempTable {
public static void main(String args[]) {
double f, c;
int counter;
counter = 0;
for(f = 1; f <= 25; f++) {
c =(( 5 / 9) * (f - 32)); /* im pretty sure it has sum thing to do with this conversion which is written
5/9(f-32)*/
System.out.println(f+"Degrees Farenheit is equivilent to: "
+c+" Degrees Celcius.");
counter++;
if(counter==5) {
System.out.println();
counter=0;
}
}
}
}
class TempTable {
public static void main(String args[]) {
double f, c;
int counter;
counter = 0;
for(f = 1; f <= 25; f++) {
c =(( 5 / 9) * (f - 32)); /* im pretty sure it has sum thing to do with this conversion which is written
5/9(f-32)*/
System.out.println(f+"Degrees Farenheit is equivilent to: "
+c+" Degrees Celcius.");
counter++;
if(counter==5) {
System.out.println();
counter=0;
}
}
}
}
if anyone could give me a hint i would be grateful, and possibly an idea how to make the code a lil better and more cleaner
thanks.
