Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Language Create a package named lab2 (no spaces, ALL in lowercase ) where you will place your lab files. Write a class named LengthConversion

Java Language

  • Create a package named lab2 (no spaces, ALL in lowercase) where you will place your lab files.
  • Write a class named LengthConversion with the following methods:
    • metersToFeet that converts length from meters to feet. The conversion formula from meters to feet is f = 3.28084 * m , where m is the number of meters, and f is the number of feet. The method will return a string with the converted rounded length measurement in feet and inches (e.g. for m = 1.75, your method will return the string 5' 9" ).
    • feetToMeters that converts length from feet to meters. The conversion formula is m = 0.3048 * f , where m is the number of meters, and f is the number of feet . The method will ask the user for the feet, then the inches, convert the values accordingly and return a string with the result in meters (e.g. for feet = 6 and inches = 2 your method will return the string 1.8796 m)
    • main that will show a menu to the user and ask what length they want to convert: (1) from meters to feet or (2) feet to meter. Then your app will ask the user for the appropriate input, store it in a variable(s) of appropriate type, pass them as an argument to the corresponding method, and display the results.

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

Explain the chemical properties of acids with examples.

Answered: 1 week ago

Question

Write the properties of Group theory.

Answered: 1 week ago