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
2 Antworten
+ 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");
}
}
+ 2
You should complete the java course before solving these questions