0

Can i do like this?

Write a Java program to prints a conversion table of inches to meters. Write a Java program to prints a conversion table of inches to meters. Display 5 inches of conversion, inch by inch. [Note: one-meter equals approximately 39.37 inches.] https://code.sololearn.com/cFEux47s4BqS/?ref=app

3rd May 2021, 5:48 PM
Kyrene
2 Respostas
+ 2
import java.util.Scanner; public class Labpractical1 { public static void main(String[] Strings) { Scanner input = new Scanner(System.in); System.out.print("Input a value for meters: "); double meters = input.nextDouble(); double inches = meters * 1/39.37; System.out.println(meters + " meters is " + inches + " inches"); } }
3rd May 2021, 5:59 PM
Atul [Inactive]
+ 2
You should complete the java course before solving these questions
3rd May 2021, 6:07 PM
Atul [Inactive]