Computer Science Homework Solutions
Problem
#179597

Programing in Java - Fahrenheit to Celsius

I have to write a Java program that converts Fahrenheit to Celsius. The formula is:
celsius = (5 / 9) * (fahrenheit - 32)
The program read a Fahrenheit degree in double from the input dialog box then converts it to Celsius and displays the result in a message dialog box.
In Java, 5 / 9 is 0, so I need to write 5.0 / 9 to obtain the correct result.
The program should also convert feet into meters. The program prompts the user to enter a number in feet, converts it to meters, and displays the result. One foot is 0.305 meters.

Solution
What is this?
By OTA - Overall OTA Rating
Yupei Xiong, PhD - 4.8/5
Purchase Cost Now
$2.19 CAD (was ~$11.97)
Included in Download
  • Plain text response
  • Attached file(s):
    • Converter.java
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse