Java program to convert degree from centrigrade to fahrenheit

Program that displays a table of centrigrade temp 0 though 20 and their fahrnheit.  Program use a loop to display the table.

Problem, the program compiles with no errors. when I enter the degrees in centrigrade they convert and display in the fahrenheit field, however, when I enter the second degree, it appears on the same line as the previous. Not sure whether I am explaining this clearly.  If someone would compile the program, you'll see what I am talking about.

Thank you in advance for your assistance.
import java.util.Scanner; 
import javax.swing.JOptionPane;
 
 
 
public class CentrigradeGay
{
	public static void main (String[] args)
	{
		final int BASE = 32; 
		final double CONVERSION_FACTOR = 9.0 / 5.0; 
		final int MIN_DEGREE = 0;
		final int MAX_DEGREE = 20;
		int degree;
		int number = 1;
		String input;
				
		Scanner keyboard = new Scanner(System.in); 
	
		System.out.print("No more than 20 entries may be entered.");
		degree = keyboard.nextInt();
		System.out.println();
			
		if (degree > 0 && degree <= 20)	
			{	
			System.out.println("Please enter temperature" );
			}
		else
			{	
			System.out.println("Entries must be in the range of 0 and 20, please re-enter: ");
			degree = keyboard.nextInt();
			}
 
			System.out.println("Centrigrade\t\tFahrenheit");
			System.out.println("============================");
	
			for (number = 1; number > 0 && number <= 20; number++)
				{	
					double centrigradeTemp; 
			
					centrigradeTemp = keyboard.nextDouble(); //read in user input
					double fahrenheitTemp;
		
					fahrenheitTemp = centrigradeTemp * CONVERSION_FACTOR + BASE; //calculate Fahrenheit temperature
						
						System.out.print(centrigradeTemp);
						System.out.print("\t\t" + fahrenheitTemp);
				}	
	}
}

Open in new window

gkilgoreAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ajay-SinghCommented:
change this
 >> System.out.print("\t\t" + fahrenheitTemp);

to

System.out.println("\t\t" + fahrenheitTemp);
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hrattanCommented:
try adding a \n

System.out.println("============================\n");
       
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.