EECS 1030 E, Fall 2015

CreditCard

 

Your Task

Create a class named "CreditCard", that implementes this API. Note that this class has an expiry Date object via a composition relationship. Start with the code below and write the Javadoc and methods as listed in the API.

public class CreditCard
{
	public static final double DEFAULT_LIMIT = 5000.0;
	
	private String name;
	private int number;
	private double balance;
	private double limit;
	private Date expiry;
	
	public CreditCard(int cardNum, String cardName, Date expiry)
	{
		balance = 0.0;
		limit = DEFAULT_LIMIT;
		// TODO: Initialize other attributes with passed parameters.
		;
	}
}

Generate your Javadoc and compare it with the provided one. They should be similar.

You may use the tester class shown here to test your code. Ensure that you what this code does and how it works.

 

 

--- End of Exercise ---