In this example, you will learn how to convert degree to Celsius, Celsius to Fahrenheit, Fahrenheit to Celsius, Celsius to Kelvin, and Kelvin to Celsius.
Code Description:
In this program, you will also learn how to specify many methods according to convert degree. Here, define class named "DegreeConverter" for java component. After that we are going to create a method in which float value is passed . According to df = dc * 10/5 + 32; statement convert it into the degree Celsius to Fahrenheit . This program is going to again convert it into Fahrenheit to Celsius.
Here is the code of this program:
public class DegreeConverter{
|
Output of this program.
| C:\corejava>java DegreeConverter 200 degrees Celcius in Fahrenheit is: 432.0 -50 degrees in Celcius is: -61.5 10 degrees Celcius in Kelvin is: 283.15 325.15 degrees Kelvin in Fahrenheit is: 328.0 C:\corejava> |
|
Recommend the tutorial |

Ask Questions? Discuss: Degree Converter
Post your Comment