import java.util.Scanner; /** * Class Example: Convers From Celsius To Fahrenheit. * NEW AND IMPROVED version with more better math! * * @author William McDaniel Albritton */ public class TemperatureConverterImproved { /** * Convers From Celsius To Fahrenheit. * * @param argumentS The commandline arguments are not used. */ public static void main(String[] argumentS) { //Initialize Input Variable.. Scanner keyboard = new Scanner(System.in); //Initialize String variables to store String input String celsiusWord = new String("blank"); //Initialize Integer (Whole Number) Variables All To Zero (0). Integer celsius = new Integer(0); Integer fahrenheit = new Integer(0); //Get The USER'S Input.. System.out.print("Please enter the temperature in Celsius: "); celsiusWord = keyboard.nextLine(); //convert string to integer celsius = Integer.parseInt(celsiusWord); //Convert The Celsius Temperature To The Corresponding Fahrenheit Temperature.. //NEED TO MULTIPLY FIRST and DIVIDE LAST, SO THAT RESULTS ARE MORE ACCURATE!!! fahrenheit = (9 * celsius)/5 + 32; //Output To The Computer Screen.. System.out.print("That is "); System.out.print(fahrenheit); System.out.print(" degrees Fahrenheit."); }//end of main() }//end of class