Java language. 1. write a conversion method that have 2 parameter 1. feet and 2. inches(as small...

60.1K

Verified Solution

Question

Programming

Java language.

1. write a conversion method that have 2 parameter 1. feet and2. inches(as small as 1/8 inch)(make sure precondition, can't besmaller than 1/8 inch)

and give output as feet in decimal place.

2 Write a method to calculate the area of a rectangle that takein width and height (feet) (as small as 1/8 inch)(make sureprecondition, can't be smaller than 1/8 inch) and round up to thecloset feet.

Write test cases for both method in J unit (including precheckthe precondition (as small as 1/8 inch))

Answer & Explanation Solved by verified expert
4.2 Ratings (713 Votes)
JAVACODEpackage ideoneimport javautilimport javalangimport javaioclass Ideone method to convert feets and inches to feets static double feetdouble feetsdouble inch if inches is less than 18 thenprecondition is not satisfied ifinch 0125 SystemoutprintlnPrecondition not satisfied return 0 returning answer by convertinginches    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students