What im trying to do is have the program to run the first set of numbers. Then Use output as 'X'. So it looks like this Tnew = Told - m(Told - Tair) Told is the last equations Tnew.
ex. new = old +6
old = 7
new = 13
new = 13 +6
repeat
Heres the code ; package heatloss;
/**
*
* @author Eric Franzen
*/
public class HeatLoss {
public static void heatloss(double x, double m, double a) {
double heatloss = x - m * (x - a);
if (x < 55) {
System.out.println("potatoe too cold");
}
else {
System.out.println(heatloss);
heatloss(x,m,a);
x = heatloss;
}
}
public static void main(String[] args) {
heatloss(80, .01515 ,25);
}
}
Okay so I changed the code to look like this:
public static double heatloss(double x, double m, double a) {
double heatloss = x - m * (x - a);
if (x < 55) {
System.out.println("potatoe too cold");
return heatloss;
}
else {
System.out.println(heatloss);
x = heatloss(x,m,a);
return heatloss;
}
}
But I get an error at line
x = heatloss(x,m,a);
That "the Assigned value is never used." Im not really sure what that means? X is clearly used in the program.