/* TempConverter.java written by William Beaver
   This little program converts a user given Celsius temp to its 
   Fahrenheit equivalent. */

import java.util.Scanner;

public class ITempConverter{
	// This computes the F equivalent of a C using the formula
	// F = (9/5)*C+32

	public static void main (String[] args){
		// First a constant for the base
		final int BASE = 32;
		final double CONVERSION_FACTOR = 9.0 / 5.0;

		// A variable to hold our final F temp and the beginning C
		double fahrenheitTemp; // note not initialized

		//get user input for celsius temp as int
		Scanner scan = new Scanner (System.in);
		System.out.print("Enter a Celsius temp (int): ");
		
		int celsiusTemp = scan.nextInt();

		// our calculation
		fahrenheitTemp = celsiusTemp * CONVERSION_FACTOR + BASE;

		// and some useful results
		System.out.println("C temp:  " + celsiusTemp);
		System.out.println("F equiv: " + fahrenheitTemp);

		System.out.println("\nLet's do another!");
		System.out.print("Enter a Celsius temp (int): ");
		
		celsiusTemp = scan.nextInt();

		// our calculation
		fahrenheitTemp = celsiusTemp * CONVERSION_FACTOR + BASE;

		// and some useful results
		System.out.println("C temp:  " + celsiusTemp);
		System.out.println("F equiv: " + fahrenheitTemp);

		System.out.println("ok. goodbye");


	}
}