Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using this format Write a class named Lengthconversion with the following methods: o meters To Feet that converts length from meters to feet. The conversion

image text in transcribed
using this format
image text in transcribed
Write a class named Lengthconversion with the following methods: o meters To Feet 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 fis 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"). o feetToMeters that converts length from feet to meters. The conversion formula is m = 0.3048 * f, where m is the number of meters, and fis 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) o 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. Add a comment at the beginning of each file indicating your name, course, and section (e.g. // John Doe, CET 3640-01123) laget. Length anversioni E B public class Lengthconversion 1 CET 3640 - OL2 40 RE Systumbrary. public static String metersToFeet (double meters) { //Compute feet ab 6 //Convert to a nice string Vlah 2 //Get the whole number for feet > Lunghar 8 > mk3 7/Multiply the fraction - 12 to get the remaining inches 9 CET 3640 - OLDU //Round it and put it nicely in the format 5' 10" 10 } 11 012- public static String feetToMeters(double feet, double inches) { //Convert 14 //Use the formula 15 // Return meters 16 } 17 18- public static void main(String[] args) { // Show menu //Get the choice from the use using Scanner //Use decision statement lo invoke the appropriate method (it or switch) //Display the results 24 ) 25

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_2

Step: 3

blur-text-image_3

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

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions