Data fields:
Create the following fields in your class.
accountNumber – Credit card number – a nine digit number (use int)
customerName - Customer’s name – a String
accountBalance - Account balance – a floating point number
Methods:
Create an accessor method and mutator method for each of the data fields.
Create a method called accountCharge() that defines a double parameter.
This method will increase the account balance by the amount sent to this method.
However, if the amount to be charged is greater than 5000, print a message to
standard output indicating that the maximum charge is $5000 and do not add this
amount to the account balance.
Create a method called account Payment() that defines a double parameter.
This method will decrease the account balance by the amount sent to this method.
However, if the amount to be paid is more than the balance, print a message to
standard output indicating that this value exceeds the balance and do not subtract
this amount from the account balance.
Create a method called printBalance() that prints the account balance to
standard output.
Create a default no argument constructor for the CreditCard class. Set the numeric
values to 0 and the String variable to null.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | 1 | 2 |