        // Maintain a positive Transaction amount.
        // Format the amount in a width of 25 characters.
public class Credit extends Transaction {
    public Credit(long amount) throws InvalidTransactionException {
        super(amount);
        if(amount <= 0){
            throw new InvalidTransactionException(
                        "Credits must be greater than zero: "+amount);
        }
    }

    protected int getFormatWidth(){
        return creditFormatWidth;
    }

    // The width of the print field.
    private final int creditFormatWidth = 25;
}
