Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Requirements 1. Write a simple class named LengthConverter which converts kilometers to miles and vice versa (1 kilometer 0.621371192 miles). It has the following two
Requirements 1. Write a simple class named LengthConverter which converts kilometers to miles and vice versa (1 kilometer 0.621371192 miles). It has the following two methods public double kmToMile(double km) public double mileToKm(double mile) If the argument is negative, an lllegalArgumentException should be thrown. 2. Write a JUnit test named LengthConverterTest to test both methods of LengthConverter. Results within 0.0001 (km or mile) of the expected results will be accepted. You should include test cases that test both valid and invalid input conditions. 3. Use Eclipse IDE to compile and run the JUnit test
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started