If you know your weight in kilograms, you can calculate your weight in pounds by
ID: 3882994 • Letter: I
Question
If you know your weight in kilograms, you can calculate your weight in pounds by multiplying your kilogram weight by 2.2. For example if you weigh 50 kilograms, your weight in pounds is 110.0.
Suppose you weigh 77 kilograms. Complete program PoundWeight in the box below by inserting a line of code (where there is now a blank line) in which variable pounds is declared and assigned its value (the product of the kilos variable and 2.2.)
Note: the variable pounds should have a double tag, not an int tag, since pounds will hold a numerical value with a decimal point.
public class PoundWeight{
public static void main(String[] args){
int kilos = 77;
System.out.println(pounds);
}
}
Explanation / Answer
public class PoundWeight
{
public static void main(String args[])
{
int kilos=50;
double pounds;
pounds = kilos * 2.2;
System.out.println(pounds);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.