// Arup Guha
// 3/3/2026
// Some tests for grading COP 3330 Program 5

public class GradingCredit {

	public static void main(String[] args) {
	
		// Create a card.
		CreditCard c1 = new CreditCard("George", "Washington", 1789);
		System.out.println(c1);
		System.out.println("\n-----------------------------------\n");
		
		// Do one charge.
		boolean okay = c1.charge(2000);
		if (okay) System.out.println("correct on first test");
		else System.out.println("first test failed");
		System.out.println("\n-----------------------------------\n");
		
		// Try a second.
		okay = c1.charge(1001);
		if (!okay) System.out.println("correct on second test");
		else System.out.println("second test failed");
		System.out.println("\n-----------------------------------\n");
		
		// Try add interest.
		c1.addInterest();
		System.out.println("test 3 "+c1);
		System.out.println("\n-----------------------------------\n");
		
		// Advance a year to get more credit =)
		c1.advanceYear();
		System.out.println("test 4 "+c1);
		System.out.println("\n-----------------------------------\n");
		
		// Now this should work.
		okay = c1.charge(1001);
		if (okay) System.out.println("correct on fifth test");
		else System.out.println("fifth test failed");
		System.out.println("\n-----------------------------------\n");
		
		// This should be more than enough!
		double amt = c1.payoff(10000);
		System.out.println("test 6 paid "+amt);
		System.out.println("\n-----------------------------------\n");
		
		// Let's see if this works differently.
		CreditCard c2 = new GoldCreditCard("John","Adams", 1797);
		System.out.println(c2);
		System.out.println("\n-----------------------------------\n");
		
		// Just print it this time
		c2.charge(7500);
		System.out.println(c2);
		System.out.println("\n-----------------------------------\n");
		
		// Lol!!!
		c2.addInterest();
		System.out.println(c2);
		System.out.println("\n-----------------------------------\n");
		
		// Testing payoff.
		amt = c2.payoff(3000);
		System.out.println("paid off "+amt);
		System.out.println(c2);
	}
}