All pastes #814193 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-13 01:48 UTC
rendered paste body
import java.util.Scanner;

public class ProgramVIone
{
    	public static void main(String[] args) 
	{
		
		double temperature; 
		int which;
		boolean stop=false;
		

		do
		{
			System.out.print("1. Fahrenheit to Celsius\n2. Celsius to Fahrenheit\n3. Exit the program\nEnter 

option:");
			which=input.nextInt();



			switch ( which ) 
			{
			case 1:  

		  		System.out.print("Input the temperature that you want to be converted:");
				Scanner input = new Scanner( System.in );
				temperature=input.nextDouble();
				System.out.println("You chose" + temperature + ".");



				break;
			case 2:   
				System.out.print("Do you want Celsius converted into Fahrenheit.");
				break;
			case 3:   
				stop=true;
				break;
			default:  
				System.out.print("Invaild option, please retry.");


 			}
		}

	while (stop==false);

 }
}