Need help with error in code

I keep getting a can not find symbol error

Page 1 of 1

1 Replies - 411 Views - Last Post: 09 September 2009 - 10:44 AM Rate Topic: -----

#1 dbfinsfan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-August 09

Need help with error in code

Post icon  Posted 09 September 2009 - 10:20 AM

//TemperatureConvert 
//Java program to convert Fahrenheit degrees to Celsius

//Algorithm
//Prompt user for Fahrenheit degrees
//Get Fahrenheit degrees from user
//Calculate Celsius degrees from Fahrenheit degrees
//Display Celsius degrees  to user


import javax.swing.JOptionPane;

public class TemperatureConvert{

  public static void main(String[] args){
  
	String userTempInput;
	 
	 						  
	 userTempInput = JOptionPane.ShowInputDialog("Input Degrees Fahrenheit", "Converter Dialog Box");

					
						  
	 
	 double fahrenheitTemp = Double.parseDouble(userTempInput);
	 
	 double celsiusTemp = (fahrenheitTemp - 32) * (5.0 / 9);
	 
	 JOptionPane.showMessageDialog(null, fahrenheitTemp + "Degrees Fahrenheit is = " + celsiusTemp + "degrees Celsius");
	 
	}
	
}  



Is This A Good Question/Topic? 0
  • +

Replies To: Need help with error in code

#2 AntonWebsters  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 88
  • View blog
  • Posts: 428
  • Joined: 15-August 09

Re: Need help with error in code

Posted 09 September 2009 - 10:44 AM

The only error I found is this...
	 userTempInput = JOptionPane.ShowInputDialog("Input Degrees Fahrenheit", "Converter Dialog Box");



Not ShowInputDialog, it should be showInputDialog. The 's' should be lower- cased.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1