Code should be in C#
Create a class called SavingsAccount. Use a static variable called annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance, indicating the amount the saver currently has on deposit. Provide method CalculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12 – this interest should be added to savingsBalance. Provide static method setAnnualInterestRate to set the annualInterestRate to a new value. Write an application to test class SavingsAccount. Create three savingsAccount objects, saver1, saver2, and saver3 with balances of $2,000.00, $3,000.00, and 0.00, respectively. Set annualInterestRate to 4%, then calculate the monthly interest and display the new balances for both savers. Then set the annualInterestRate to 5%, calculate the next month’s interest and display the new balances for both savers.
Technical Requirements:
Create SavingsAccount class with static variable annualInterestRate and private instance variables savingsBalance (double) and savingsAccountName (string).
Create a mutator method to set the savingsAccountName. Call this method setSavingsAccountName. The method should take a string argument and return void.
Create an accessor method to retrieve the savingsAccountName. Call this method getSavingsAccountName. The method should take no arguments and return a string (i.e. the savingsAccountName).
Create a mutator method to set the savingsBalance. Call this method setSavingsBalance. The method should take a double argument and return void.
Create an accessor method to retrieve the savingsBalance. Call this method getSavingsBalance. The method should take no arguments and return a double (i.e. the savingsBalance).
Include two constructors. The first takes no arguments and sets the savingsBalance variables to zero and sets the savingsAccountName to an empty string by calling the second (i.e. two argument) constructor with 0 and an empty string. The second constructor takes one double argument (the savingsBalance) and one string argument (the savingsAccountName), and sets the savingsBalance by calling the setSavingsBalance method and setsavingsAccountName method, respectively.
Create CalculateMonthlyInterest method with formula. The method should return void.
Create setAnnualInterestRate method to take a double argument representing the annualInterestRate and return void.
Create PrintSavingsAccount method to display the savingsBalance, savingsAccountName, and annualInterestRate for an object. Use the output shown below as a guideline for the display.
Create a separate class called SavingsAccountTest, which contains the Main() method.
In the Main() method, create three savingsAccount objects called saver1, saver2, and saver3. Initialize saver1 and saver2 with the balances listed above and the names “Saver_One” and “Saver_Two”, respectively. Do not initialize saver3 with anything. Instead, create the object by invoking its zero-argument constructor, which will initialize its balance to 0 and its name to an empty string.
In the Main() method, call setAnnualInterestRate to set the interest rate to 4%.
Next, call the setSavingsAccountName for saver3 to set its name to “Saver_Three”. Then, call the setSavingsAccountBalance for saver3 to set its balance to $50,000.
Print the results by calling PrintSavingsAccount for each object.
Next, call the CalculateAnnualInterestRate method for all three saver objects.
Print the results again by calling PrintSavingsAccount for each object.
Next, change the annualInterestRate to 5% by calling the setAnnualInterestRate method.
Print the results again by calling PrintSavingsAccount for each object.
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
// SavingAccount class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace System
{
public class SavingAccount
{
// interest rate for all accounts
private static decimal annualInterestRate = 0;
private decimal savingsBalance; // balance for current
account
// constructor, creates a new account with the specified
balance
public SavingAccount(decimal balance)
{
savingsBalance = balance;
} // end constructor
// add the monthly interest to the balance
public void CalculateMonthlyInterest()
{
savingsBalance += savingsBalance * (annualInterestRate /
12.0M);
} // end method CalculateMonthlyInterest
// modify interest rate
public static void ModifyInterestRate(decimal newRate)
{
annualInterestRate =
(newRate >= 0 && newRate <= 1) ? newRate :
0.04M;
} // end method ModifyInterestRate
// get string representation of SavingAccount
public override string ToString()
{
return string.Format("{0:C}", savingsBalance);
} // end method ToString
} // end class SavingAccount
}
// Tests the SavingAccount class.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace System
{
public class SavingAccountTest
{
public static void Main(string[] args)
{
SavingAccount saver1 = new SavingAccount(2000);
SavingAccount saver2 = new SavingAccount(3000);
SavingAccount.ModifyInterestRate(0.04M);
Console.WriteLine("Monthly balances for one year at .04");
Console.WriteLine("Balances:");
Console.WriteLine("{0,10}{1,10}{2,10}", "", "Saver 1", "Saver
2");
Console.WriteLine("{0,-10}{1,10}{2,10}", "Base",
saver1.ToString(), saver2.ToString());
for (int month = 1; month <= 12; month++)
{
string monthLabel = string.Format("Month {0}:", month);
saver1.CalculateMonthlyInterest();
saver2.CalculateMonthlyInterest();
Console.WriteLine("{0,-10}{1,10}{2,10}", monthLabel,
saver1.ToString(), saver2.ToString());
} // end for
}
}
}

Kindly revert for any queries
Thanks.
Code should be in C# Create a class called SavingsAccount. Use a static variable called annualInterestRate to...
Application should be in C# programming language
Create a class called SavingsAccount. Use a static
variable called annualInterestRate to store the annual interest
rate for all account holders. Each object of the class
contains a private instance variable savingsBalance, indicating the
amount the saver currently has on deposit. Provide method
CalculateMonthlyInterest to calculate the monthly interest by
multiplying the savingsBalance by annualInterestRate divided by 12
– this interest should be added to
savingsBalance. Provide static method
setAnnualInterestRate to set the...
JAVA Create a class called SavingsAccount. The class should have a static variable named, annualInterestRate, to store the annual interest rate for all account holders. Each object of the class should contain a private instance variable named, savingsBalance, indicating the amount the saver currently has on deposit. Write methods to perform the following: calculateMonthlyInterest – calculates the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12. This interest should be added to the balance. depositAmount – allows the...
Create a .java file that has class SavingsAccount. Use a static
variable annualInterestRate to store the annual interest rate for
all account holders. Each object of the class contains a private
instance variable savingsBalance indicating the amount the saver
currently has on deposit. Provide method calculateMonthlyInterest
to calculate the monthly interest by multiplying the savingsBalance
by annualInterestRate divided by 12- this interest should be added
to savingsBalance. Provide a static method setInterestRate that
sets the annualInterestRate to a new value....
Create the class savings account. Use the static variable annualInterestRate to store the annual interest rate for all account holders. Each object of the classcontains a private instance variable savingsBalance, indicating the amount the saver currently has on deposit. Provide method CalculateMonthlyInterest to calculate themonthly interest by multiplying the savingsBalance by annualInterestRate divided by 12, this interest should be added to savingsBlance, Provide static methodModifyInterestRate to set the annualInterestRate to a new value. Write an application to test class SavingsAccount....
Define a class SavingsAccount with following characteristics. Use a static variable annualInterestRate of type float to store the annual interest rate for all account holders. Private data member savingsBalance of type float indicating the amount the saver currently has on deposit. Method calculateMonthlyInterest to calculate the monthly interest as (savingsBalance * annualInterestRate / 12). After calculation, the interest should be added to savingsBalance. Static method modifyInterestRate to set annualInterestRate. Parameterized constructor with savingsBalance as an argument to set the value...
Using C++ Please make sure you comment each section of the program so I can better understand it. Thank you! Assignment Content You are now working for a bank, and one of your first projects consists of developing an application to manage savings accounts. Create a C++ program that does the following: Creates a SavingsAccount class Uses a static data member, annualInterestRate, to store the annual interest rate for each of the savers Ensures each member of the class contains...
Now create another class named SavingsAccount. This should be a subclass of BankAccount. A SavingsAccount should have an interest rate that is specified in its constructor. Furthermore, there should be a method, addInterest, that deposits interest into account, based on the account balance and interest rate. Create another subclass of BankAccount named CheckingAccount. A CheckingAccount should keep track of the number of transactions made (deposits and withdrawals). Name this field transactionCount. Also, the set fee for transactions is three dollars,...
TASK 1 Create a new class called CheckingAccount that extends BankAccount. It should contain a static constant FEE that represents the cost of clearing onecheck. Set it equal to 15 cents. Write a constructor that takes a name and an initial amount as parameters. Itshould call the constructor for the superclass. It should initializeaccountNumber to be the current value in accountNumber concatenatedwith -10 (All checking accounts at this bank are identified by the extension -10). There can be only one...
C++ implement and use the methods for a class called Seller that represents information about a salesperson. The Seller class Use the following class definition: class Seller { public: Seller(); Seller( const char [], const char[], const char [], double ); void print(); void setFirstName( const char [] ); void setLastName( const char [] ); void setID( const char [] ); void setSalesTotal( double ); double getSalesTotal(); private: char firstName[20]; char lastName[30]; char ID[7]; double salesTotal; }; Data Members The...
a) Create saving account Class. Use a static data member annualBonusRate to store the annual bonus rate for each of the savers (objects) b) The class contains a private data member savingBalance indicating the amount the saver currently has on deposit. c) Provide member function calculate MonthlyBonus that calculates the monthly bonus by multiplying the savingBalance by annualBonusRate divided by 12; this bonus should be addad to savingBalance. d) Provide a static member function modifyBunusRate that has a parameter and...