Question: (1) (7 Points) Write Java code to implement a class called Account that is used to keep track of a bank account with a varying

 (1) (7 Points) Write Java code to implement a class called

(1) (7 Points) Write Java code to implement a class called Account that is used to keep track of a bank account with a varying annual interest rate. The class is identified as follows: Includes two double instance variables, balance and annual Rate. Implement a constructor to initialize the instance variables to given input values. Implement a getter method for the balance variable. Implement a method, called addMoney, to add a given amount of money to the account's balance. Implement a method, called getInterest, to return the amount of interest to be gained by the account according to the current account's balance and annualRate. (2) (3 Points) After defining your class, write Java statements to do the following (write just the statements and not the whole driver class): Instantiate an account with initial values of 1000 dollars and 5% interest rate. O Add 50 dollars to the account's balance. o Print the amount of interest to be gained by the account this year

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!