All pastes #203016 Raw Edit

mokky

public java v1 · immutable
#203016 ·published 2006-10-14 21:48 UTC
rendered paste body
public class Temp {	public static void main (String args[])	{		Temp tempThing = new Temp();		tempThing.inputData();		tempThing.dataCalc();		tempThing.outputData();	}	char tempType;	double temp;	double result;		public void inputData()	{		tempType = IBIO.inputChar("Enter a C or an F: ");		temp = IBIO.inputDouble("Enter a temprature: ");			}		public void dataCalc()	{		if ( ( tempType == ('F')) || (tempType ==('f')))		    result = temp * 9 / 5 + 32;		else			result = (temp-32) * 5 / 9;				}		public void outputData()	{		IBIO.output ("The converted temperature is: "+ result);	}}