NEED HELP! ANY ONE KNOW JAVA?
#4
Re: NEED HELP! ANY ONE KNOW JAVA?
heres my code....some one help me..this ---- is due tomorow
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;
for (int KGS = 1; 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.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;
for (int KGS = 1; 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");
}
}
}