Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program to convert from US units to metric units. Your user will have 3 options in a main menu Length Volume Temperature

Write a Java program to convert from US units to metric units.

Your user will have 3 options in a main menu

Length

Volume

Temperature

The length option will offer the user the option of converting from inches to centimeters or from centimeters to inches.

The volume option will offer the user the option of converting from gallons to liters or from liters to gallons

The temperature option will offer the user the option of converting from Fahrenheit to Celsius or from Celsius to Fahrenheit.

The table of conversions is below.

You are to do a functional decomposition here at the very least have methods for input, for processing, and for output. The goal here is for main() to be self-documenting. Follow the examples from class.

You may choose to use JOptionPane for input and output as demonstrated in class.

All output should be well formatted.

A run of your program might look like this (if you were using System.out.println and Scanner) user input is shown in red:

Conversion options:

Length

Volume

Temperature

Which conversion would you like to perform? 1

You have chosen length conversion.

Conversion options:

Inches to centimeters

Centimeters to inches

Which conversion would you like? 2

Enter the number of centimeters: 5

5 centimeters is equal to 1.968505 inches

Conversion Table

Length

1 in

2.54 cm

1 cm

0.393701 in

Volume

1 gallon

3.78541 liters

1 liter

0.264172 gallons

Temperature

Celsius

(Fahrenheit 32) * 5 / 9

Fahrenheit

Celsius * 9 / 5 + 32

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

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions

Question

Define organisational jargon.

Answered: 1 week ago