A declare a class named bank b declare four instance


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: A declare a class named bank b declare four instance
Reference No:- TGS02560418

Now Priced at $10 (50% Discount)

Recommended (96%)

Rated (4.8/5)