Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need someone to help me solve the attached question... Write a full program wi

ID: 3726669 • Letter: I

Question

I need someone to help me solve the attached question...

Write a full program with a function named convert that takes two integer arguments corresponding to kilograms and grams, passes them to a function named calculate that calculates the amount in pounds and returns the corresponding floating point value in pounds back to convert for display. 1 kg 2.20462 lbs, and therefore 1g 00220462 Ibs. This must be a full program that uses two auxiliary functions, and a sample run should look something like this: 3. Welcome to the converter. printed from the main function Enter-1 to quit, otherwise enter the kg and g amount to convert: 9 800 printed from convert 9 kg 800g is 21.605276 lbs. printed from convert() Enter-1 to quit, otherwise enter the KG amount to convert: 3 200 printed from convert() 3 kg 200g is 7.054784 lbst printed from convert() Enter-1 to quit, otherwise enter the KG amount to convert: -1 printed from convert() Goodbye. printed from convert() or main(), your choice ** "Don't forget to use three functions: main(), convert(), and calculate().***

Explanation / Answer

import java.util.*;
public class Converter {
double calculate(int kg,int g)
{return (1.0)*(kg*2.20462)+(g*0.00220462);
}
void convert(){
Scanner sc =new Scanner(System.in);
int kg=-999,g=-999;
while(kg!=-1)
{ System.out.print("Eneter -1 to quit, other wise enter");
System.out.print("kg and g amount to convert:");
kg=sc.nextInt();
if(kg==-1)
{System.out.println("Goodbye.");break;
}
g=sc.nextInt();
System.out.println(kg+"kg "+g+"g is :"+(float)calculate(kg,g)+" lbs");
}
}
public static void main(String args[])
{
System.out.println("Welcome to converter.");
Converter c=new Converter();
c.convert();
}
  
}