Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

It is the question about JAVA programming It's working when I input 1625, but If I input 1.625, It's error. What is wrong? please correc

It is the question about JAVA programming
It's working when I input 1625,
but If I input 1.625, It's error.
What is wrong? please correc this image text in transcribed
image text in transcribed
image text in transcribed
Q 100% [2.4.] Convert from meter to millimeter Write a few more lines of code to convert your height from meter to millimeter. Suppose your height is 1.625 meter. The result should show 1625 millimeter. Note: the text in bold and underlined is the input from user (use Scanner for the input) Input your height in meter: 1.625 The height in mm is 1625 millimeter import java.util.Scanner: class Main public static void main(String[] args) throws Exception { Scanner console = new Scanner(System.in); System.out.print("Input your height in meter: "); double meter = console.nextInt(); double millimeter = (double)meter * 1000; System.out.println("The height in mm 18" + millimeter + "millimeter"): I . ( ) > Input your height in meter: 1.625 Makefile:6: recipe for target 'java_run' failed make: *** (java_run] Error 1 Exception in thread "main" java.util. InputMismatchException at java.base/java.util.Scanner.throwFor(Scanner.java:939) at java.base/java.util.Scanner.next(Scanner.java:1594)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Accounting questions