import javax.swing.JOptionPane;
import javax.swing.*;
import java.util.*;

public class PlanetQuiz
{

	public static void main(String[] args)
	{
		


	
	
		// declare variables
		String[] planetName = {"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"};
		String[] orderOfPlanets = {"first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth"};
		String inputAns = "";
		int numCorrect = 0;
		String nameOfPlanet;
		boolean isCorrect;
		int x;
		String[] myAnswers = new String[9];

		
		for (x = 0; x < myAnswers.length; ++x)
		{	
			inputAns = JOptionPane.showInputDialog(null, "What is the " + orderOfPlanets[x] + " planet in our solar system?");
			myAnswers[x] = inputAns;
				if (myAnswers[x].equalsIgnoreCase(planetName[x]))
				{
					numCorrect += 1;
				}		
		
		}
	
		System.out.println("You got " + numCorrect + " Correct out of 9!");

		for (x = 0; x < myAnswers.length; ++x)
		{
			System.out.println((x + 1) + ". Correct answer: " + planetName[x] + " - your answer: " + myAnswers[x]);
		}

		System.exit(0);
}
	
	


}
