English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

write a program, called Kg, that converts the following integer values 5,40,85 and 120 kilograms to pounds (1lb= .454kg) and displays the result to the monitor. create 4 integer variables to hold the 4 kg values. similarly, you can create 4 double variables to hold the 4 ib values

2007-02-27 21:55:44 · 1 answers · asked by LULU 1 in Computers & Internet Programming & Design

1 answers

class convert2{
public static void main(String arg[]){
int x=5;
int y=40;
int z=85;
int t=120;
double X=x*1.0/0.454;
double Y=y*1.0/0.454;
double Z=z*1.0/0.454;
double T=t*1.0/0.454;
System.out.println(x+" kg= " +X +" lb "+y+" kg = " + Y + " lb "+ z +" kg= "+Z+" lb " +t+" kg= " + T +" lb");
}
}

2007-02-27 22:09:43 · answer #1 · answered by abd 5 · 0 0

fedest.com, questions and answers