Write java code for the class bank as specified below a


Write Java code for the class Bank as specified below.

(a) Declare a class named Bank.

(b) Declare four instance variables as follows, all must be private:

The first variable is of type String and named accountID.

The second variable is of type String and named customer. The third variable is of type double and named balance.

The fourth variable is of type String and named dateOpened.

(c) Declare a public constructor that takes in no parameters and does the following: The variable customer is initialized to "John Doe"

The variable balance is initialized to 100.0

The variable dateOpened is initialized to "12/12/2012" The variable accountID is initialized to "Testing"

(d) Declare a public method deposit that takes in a double parameter named amount, adds this parameter amount to the existing balance, and returns the updated value of balance.

Solution Preview :

Prepared by a verified Expert
Business Management: Write java code for the class bank as specified below a
Reference No:- TGS02564099

Now Priced at $20 (50% Discount)

Recommended (97%)

Rated (4.9/5)