Create an accessor method and mutator method for each of


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 accountPayment() 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.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Create an accessor method and mutator method for each of
Reference No:- TGS02392343

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)