[SOLVED] CSIS 209 PROGRAMMING ASSIGNMENT 4: 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.
[SOLVED] CSIS 209 PROGRAMMING ASSIGNMENT 4: 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.
[SOLVED] CSIS 209 PROGRAMMING ASSIGNMENT 4: 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.
[SOLVED] CSIS 209 PROGRAMMING ASSIGNMENT 4: 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.
[SOLVED] CSIS 209 PROGRAMMING ASSIGNMENT 4: 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.
[SOLVED] CSIS 209 PROGRAMMING ASSIGNMENT 4: 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.
[SOLVED] CSIS 209 PROGRAMMING ASSIGNMENT 4: 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%.
[SOLVED] CSIS 209 PROGRAMMING ASSIGNMENT 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.