NEED HELP! ANY ONE KNOW JAVA?
#17
Re: NEED HELP! ANY ONE KNOW JAVA?
really this probably wont work but keep in mind i havent done this stuff for awhile, i believe your issue is in your for loop because it seems you are calling on values that are not defined above. Also keep in mind i cant remeber how the brackets are supposed to be used when it comes for seperation of tasks but review all of them. import acm.program.*;
import acm.io.*;
public class Lab6 extends Program
{
public void run ()
{
IOConsole io = getConsole ();
final int LAST_KGS = 199;
final double POUNDS_PER_KG = 2.2;
int pounds = 25;
int KGS = 1;
for (KGS<LAST_KGS; KGS = KGS +2)
{
String s = String.format("%3d\t\t%3.2f\t", KGS, KGS * POUNDS_PER_KG);
io.print( KGS );
io.print(KGS * POUNDS_PER_KG +"\t");
io.print(pounds +"\t\t");
io.print(pounds/POUNDS_PER_KG +"t\t\t");
}
}
}
import acm.io.*;
public class Lab6 extends Program
{
public void run ()
{
IOConsole io = getConsole ();
final int LAST_KGS = 199;
final double POUNDS_PER_KG = 2.2;
int pounds = 25;
int KGS = 1;
for (KGS<LAST_KGS; KGS = KGS +2)
{
String s = String.format("%3d\t\t%3.2f\t", KGS, KGS * POUNDS_PER_KG);
io.print( KGS );
io.print(KGS * POUNDS_PER_KG +"\t");
io.print(pounds +"\t\t");
io.print(pounds/POUNDS_PER_KG +"t\t\t");
}
}
}