CovertFahrenheitToCelsius

CovertFahrenheitToCelsius - double Fahrenheit =

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/**Trinity Martin *Week 01 * Lab 1.1 * IT218 * This program converts Fahrenheit degrees to Celsius degrees */ package converter; p import javax.swing.JOptionPane; i public class CovertFahrenheitToCelsius { public static void main(String[] args) { String Fahrvalue = JOptionPane.showInputDialog(" Enter the degrees Fahrenheit to convert to Celsius: "); //convert user input to double
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: double Fahrenheit = Double.parseDouble(Fahrvalue); // convert to celsius double Celsius = (5.0/9.0) * (Fahrenheit - 32); //Display results String output = Fahrenheit + " Degrees Fahrenheit is " + Celsius + " in Degrees Celsius"; JOptionPane.showMessageDialog(null, output); // show the answer } }...
View Full Document

Ask a homework question - tutors are online