Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!