import cs1.Keyboard;
import java.text.DecimalFormat;

public class GPA_use
{
	String name;
	int cr1, cr2, cr3;
	double gr1, gr2, gr3;

	public static void main(String[] args)
	{
		GPA_use s1 = new GPA_use();	//create new instance of GPA_use class
		s1.Input();					//call Input method
		s1.display();
	}

	public void Input()
	{
		System.out.print("Enter student's name: \t");
		name = Keyboard.readString();

		System.out.print("Enter first grade: \t");
		gr1 = Keyboard.readDouble();
		System.out.print("Number of credits: \t");
		cr1 = Keyboard.readInt();
		System.out.print("Enter second grade: \t");
		gr2 = Keyboard.readDouble();
		System.out.print("Number of credits: \t");
		cr2 = Keyboard.readInt();
		System.out.print("Enter third grade: \t");
		gr3 = Keyboard.readDouble();
		System.out.print("Number of credits: \t");
		cr3 = Keyboard.readInt();
	}

	public void display()
	{
		DecimalFormat fred = new DecimalFormat("0.00");

		GPA student1 = new GPA(gr1,gr2,gr3,cr1,cr2,cr3); //create new instance of GPA class

		System.out.println("\nGPA for " +name+ " is: " +fred.format(student1.calcGPA()));
		System.out.println("Letter grade: " +student1.Letter());
		System.out.println(student1.Status());

		System.out.println ("\n\n\n\n\n\n\n\n");
	}
}