Couple things.
1) what does slut mean in your language? exit?
2) f isn't going to be calculated correctly since your expression is an integer. use 9.0 instead of 9 to make it a double.
3) why is this in your while loop condition?
while(starttemp < slut &&
starttemp > absnoll && starttemp <= slut);
if your temperature is only increasing, there's no way for the start temperature to be below absolute zero. instead, move this above the loop as part of input validation
4) why do you have this in your while loop condition twice?
while(
starttemp < slut && starttemp > absnoll &&
starttemp <= slut);
5) since starttemp is never changing, this shouldn't be in your while loop condition at all. i think you're just thinking of loop invariants?
6) you seem to be confusing
do...while and
for loops.
do(int i=starttemp; i <= slut; i+=1*intervall);
this parenthesis expression is in
for loops, not
do...while loops, and there's no semi colon at the end.
my advice is drop the do...while loop and use a
for loop.
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.htmlhttp://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.htmlThis post was edited by carteblanche on Jan 25 2015 09:57am