This is for java programming
Please Show plenty of comments so I can follow the steps
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 for the account (default 0)
• A private double data field named annualInterestRate that stores the current interest rate (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 that creates a default account.
• A constructor that creates and account with the specified id and initial balance.
• The accessor and mutator methods for id, balance, and annualInterestRate.
• The accessor method for dateCreated.
• A method named getMonthlyInterestRate() that returns the monthly interest rate.
• A method named getMonthlyInterest() that returns the monthly interest.
• A method named withdraw that withdraws a specified amount from the account.
• A method named deposit that deposits a specified amount to the account.
Draw the UML diagram for the class and then implement the class. (Hint: the method getMonthlyInterest() is to return monthly interest, not the interest rate. Monthly interest is balance * monthlyInterestRate, where monthlyInterestRate is annualInterestRate / 12. Note that annualInterestRate is a percentage, e.g. 4.5%. You need to divide it by 100).
Write a test program that creates an Account object with an account ID of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and print the balance, the monthly interest, and the date when this account was created.
Source Code in Java:
import java.util.Date;
class Account
{
//member variables
private int id;
private double balance,annualInterestRate;
private Date dateCreated;
Account() //default constructor
{
//setting variables to default values
id=0;
balance=0;
annualInterestRate=0;
dateCreated=new Date(); //setting to current date
}
Account(int id,double balance) //parametrized constructor
{
this(); //calling default constructor
//setting variables to parameter values
this.id=id;
this.balance=balance;
}
//accessor methods - to access the value of the variables
int getId()
{
return id;
}
double getBalance()
{
return balance;
}
double getAnnualInterestRate()
{
return annualInterestRate;
}
Date getDateCreated()
{
return dateCreated;
}
//mutator methods - to change the value of the variables
void setId(int id)
{
this.id=id;
}
void setBalance(double balance)
{
this.balance=balance;
}
void setAnnualInterestRate(double annualInterestRate)
{
this.annualInterestRate=annualInterestRate;
}
//helper methods
//method to calculate and return monthly interest rate
double getMonthlyInterestRate()
{
return annualInterestRate/12;
}
//method to calculate and return monthly interest
double getMonthlyInterest()
{
return balance*getMonthlyInterestRate()/100;
}
//method to withdraw a certain amount from the account
void withdraw(double amount)
{
if(amount>balance) //checking if withdraw is not possible
System.out.println("Withdraw cannot be done, not enough
balance!");
else
{
balance-=amount;
System.out.println(amount+" successfully withdrawn!");
}
}
//method to deposit a certain amount into the account
void deposit(double amount)
{
balance+=amount;
System.out.println(amount+" successfully deposited!");
}
}
class AccountTest
{
public static void main(String args[])
{
//testing the Account class
Account test=new Account(1122,20000);
test.setAnnualInterestRate(4.5);
test.withdraw(2500);
test.deposit(3000);
System.out.println("Balance: "+test.getBalance());
System.out.println("Monthly Interest:
"+test.getMonthlyInterest());
System.out.println("Date created: "+test.getDateCreated());
}
}
Output:

This is for java programming Please Show plenty of comments so I can follow the steps...
9.7 (The Account class) Design a class named Account that contains: • A private int data field named id for the account (default o). • A private double data field named balance for the account (default o). • A private double data field named annualInterestRate that stores the current interest rate (default o). Assume that all accounts have the same interest rate. • A private Date data field named dateCreated that stores the date when the account was created. •...
New to python if you can add screenshort also, i am using python
3
7.3 (The Account class) Design a class named Account that contains A private int data field named id for the account. A private float data field named annualInterestRate that stores the current A constructor that creates an account with the specified id (default 0), initial The accessor and mutator methods for id, balance, and annualInterestRate A private float data field named balance for the account. interest...
(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 for the account (default 0). A private double data field named annualInterestRate that stores the current interest rate (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 that creates a default...
PYTHON PROGRAMMING LANGUAGE
Design a class named Savings Account that contains: A private int data field named id for the savings account. A private float data field named balance for the savings account. A private float data field named annuallnterestRate that stores the current interest rate. A_init_ that creates an account with the specified id (default 0), initial balance (default 100), and annual interest rate (default 0). . The accessor and mutator methods for id, balance, and annuallnterestRate. A method...
Design a class named BankAccount that contains: 1. A private int data field named accountId for the account. 2. A private double data field named accountBalance for the account (default 0). 3. A private double data field named annualInterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate. 4. A private Date data field named dateCreated that stores the date when the account was created. 5. A private int data field named numberOfDeposits...
Design a class that contains: we have to make 3 files header file , one .cpp file for function and one more main cpp file 9.3 (The Account class) Design a class named Account that contains: An int data field named id for the account. A double data field named balance for the account. A double data field named annualInterestRate that stores the current interest rate. A no-arg constructor that creates a default account with id 0, balance 0, and...
Unable to find out why am I getting: Account.java:85: error: reached end of file while parsing import java.util.*; class Account{ private int id; private double balance; private double annualInterestRate; private Date dateCreated; public Account() { id = 0; balance = 0; annualInterestRate = 0; dateCreated = new Date(); } public Account(int id1, double balance1) { id =id1; balance = balance1; dateCreated = new Date(); } public void setId(int id1) { id=id1; } public void setBalance(double balance1) { balance = balance1;...
Need help creating a Java program with mandatory
requirements!
VERY IMPORTANT: The George account class instance must be in the
main class, and the requirement of printing a list of transactions
for only the ids used when the program runs(Detailed in the
Additional simulation requirements) is extremely important! Thank
you so very much!
Instructions: This homework models after a banking situation with ATM machine. You are required to create three classes, Account, Transaction, and the main class (with the main...
IN JAVAThe code is attached below has the Account class that was designed to model a bank account. An account has the properties account number, balance, annual interest rate, and date created, and methods to deposit and withdraw funds. I need creat program using the 2 java programs.Create two subclasses for checking and savings accounts. A checking account has an overdraft limit, but a savings account cannot be overdrawn.I need to write a test program that creates objects of Account,...
Hello, I'm very new to programming and I'm running into a problem with the system.out.println function in the TestAccount Class pasted below. Account Class: import java.util.Date; public class Account { private int accountId; private double accountBalance, annualInterestRate; private Date dateCreated; public Account(int id, double balance) { id = accountId; balance = accountBalance; dateCreated = new Date(); } public Account() { dateCreated = new Date(); } public int getId() { return...