Write a test program that creates an account object with an


The Account class

Design a class named Account that contains:

  • a private int data field named id for the account (default 0)
  • a private double data field named balance (default 0)
  • a private double data field named annualInterestRate (default 0). Assume all accounts have the same interest rate.
  • a private Date data field named dateCreated that stores the date when the account was created
  • A no-arg constructor
  • A constructor that creates an account with the specified id and balance
  • Accessor and mutator methods for id, balance and annualInterestRate
  • accessor method for dateCreated
  • a method called getMonthlyInterest() that returns the monthly interest (calculated as balance* monthlyInterestRate. monthlyInterestRate is annualInterestRate/12. annualInterestRate is a percentage like 4.5%)
  • a method called withdraw that withdraws a specified amount from the account
  • a method called deposit that deposits a specified amount to the account

Program: Write a test program that creates an Account object with an ID of 1122, a balance of 20000USD, and an annual interest rate of 4.5%.

Use the withdraw method to withdraw 2.500USD, use the deposit method to deposit 3000USD and print the balance, monthly interest and the date when the account was created.

Can you give the answer ASAP and there is no word limit?

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a test program that creates an account object with an
Reference No:- TGS0946541

Expected delivery within 24 Hours