Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

When a user runs your code it should convert one measurement of length from the original units to the new units. One at a time,

When a user runs your code it should convert one measurement of length from the original units to the new units. One at a time, the user should be asked to enter the 1. original units 2. original amount (the number) 3. new units Your program should attempt to understand the users input, and if it fails it should ask the user to try again. For example, if the user enters kmm instead of km accidentally, the program should not crash, but should instead notify the user that kmm is not understood, and to try again. Your program should not crash because of bad user input. At the end of execution, your program should output the result of the conversion in a readable format.

requirement

Exactly one file submitted in Canvas with name LengthConversion.java Compiles and runs without errors or warnings Adheres to the coding standards Uses TextIO or Scanner to retrieve from the user the (1) original units, (2) original amount, and (3) new units. Processes the user input in such a way that, even if the user makes a mistake or enters something invalid the program does not crash, but instead asks the user to try again. If the user gives bad input repeatedly, the program should continue to instruct the user to try again rather than crashing. Correctly converts and displays the length from the original units to the new units. The user should be able to choose inches, feet, yards, miles, millimeters, centimeters, meters, or kilometers for their units. To earn full points you need to include these eight units, but feel free to use more if you want. You should accomodate the user if they use an abbreviation, for example km instead of kilometers.

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

Step: 3

blur-text-image

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions