Question

In: Computer Science

Create a SavingsAccount class to store data of savers (account holders). Your class should match the...

Create a SavingsAccount class to store data of savers (account holders). Your class should match the following specifications.
1. Each instance of the class contains a private data member savingsBalance indicating the amount the saver currently has on deposit, saver’s name, saver’s CNIC, account number (this has to be unique) and a member to store saver status (if savingsBalance > 10000 then status changes to gold otherwise silver).
2. Class also has a data member annualInterestRate to store the annual interest rate which will be the same for all the savers.
3. Implement a default constructor with minimum savingsBalance of 100, and other fields as well. Also create a parameterized constructor if a customer wants to open an account with a different starting balance.
4. Provide member function calculateMonthlyInterest that calculates the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12; this interest should be added to savingsBalance.
5. Provide a recursive member function turnInToGold that returns the number of months a saver need to become gold member
6. Provide a member function modifyInterestRate that sets the annualInterestRate to a new value.
7. Provide a function that returns the total number of account holders with the bank.
8. Write main() to test class SavingsAccount . Instantiate two different objects of class SavingsAccount, s1 and s2, with balances of $2000.00 and $3000.00, respectively. Set the annualInterestRate to 3 percent. Then calculate the monthly interest and print the new balances for each of the savers. Then set the annualInterestRate to 4 percent, calculate the next Month’s interest and print the new balances for each of the savers. Also print the months it will take for both to become gold savers of bank.

Solutions

Expert Solution

Coding:-

Output:-

Thank You...!!!

For any query, please comment.


Related Solutions

(java ) Create class SavingsAccount. Use a static variable annualInterestRate to store the annual interest rate...
(java ) Create 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 ondeposit. Provide method calculateMonthlyInterest to calculate the monthly www.oumstudents.tk interest by multiplying the savingsBalance by annualInterestRate divided by 12 this interest should be added to savingsBalance. Provide a static method modifyInterestRate that sets the annualInterestRate to a new value. Write a program...
Create a class that will store all the information needed for a song. Your class will...
Create a class that will store all the information needed for a song. Your class will store the following data: A string for the song title. A string for the Artist/Band title A string for the Album/Compilation Name A string for the Genre A boolean called liked that represents whether you like the song The class will have the following methods: A constructor that will make a Song object from a song title, artist and album name A constructor that...
(In C++) Bank Account Program Create an Account Class Create a Menu Class Create a main()...
(In C++) Bank Account Program Create an Account Class Create a Menu Class Create a main() function to coordinate the execution of the program. We will need methods: Method for Depositing values into the account. What type of method will it be? Method for Withdrawing values from the account. What type of method will it be? Method to output the balance of the account. What type of method will it be? Method that will output all deposits made to the...
PYTHON- create a queue class that uses a LINKEDLIST in order to store data. this queue...
PYTHON- create a queue class that uses a LINKEDLIST in order to store data. this queue will call on a linkedlist class class Queue: def __init__(self): self.items = LinkedList() #has to be O(1) def enqueue(self, item): #has to be O(1) def dequeue(self): def is_empty(self): def __len__(self):
Create an unsorted LIST class. Each list should be able to store 100 names.
Create an unsorted LIST class. Each list should be able to store 100 names.
Create a Class to contain a customer order Create attributes of that class to store Company...
Create a Class to contain a customer order Create attributes of that class to store Company Name, Address and Sales Tax. Create a public property for each of these attributes. Create a class constructor without parameters that initializes the attributes to default values. Create a class constructor with parameters that initializes the attributes to the passed in parameter values. Create a behavior of that class to generate a welcome message that includes the company name. Create a Class to contain...
12. Create a class called bMoney. It should store money amounts as long doubles. Use the...
12. Create a class called bMoney. It should store money amounts as long doubles. Use the function mstold() to convert a money string entered as input into a long double, and the function ldtoms() to convert the long double to a money string for display. (See Exercises 6 and 10.) You can call the input and output member functions getmoney() and putmoney(). Write another member function that adds two bMoney amounts; you can call it madd(). Adding bMoney objects is...
Create a Square Class and Create a graphical representation of your Square class - your class...
Create a Square Class and Create a graphical representation of your Square class - your class will have the following data fields: double width, String color. - provide a no-args constructor. - provide a constructor that creates a square with the specific width - implement method getArea() - implement method getPerimeter() - implement method setColor(). - draw a UML diagram for your class - write a test program that will create a square with the width 30, 40 and 50....
The Account class Create a class named Account, which has the following private properties:
in java The Account class Create a class named Account, which has the following private properties: number: long balance: double Create a no-argument constructor that sets the number and balance to zero. Create a two-parameter constructor that takes an account number and balance. First, implement getters and setters: getNumber (), getBalance (), setBalan newBalance). There is no setNumber () once an account is created, its account number cannot change. Now implement these methods: void deposit (double amount) and void withdraw (double amount). For both these methods, if the amount is less than...
The Account class Create a class named Account , which has the following private properties:
 The Account class Create a class named Account , which has the following private properties: number: long balance: double Create a no-argument constructor that sets the number and balance to zero. Create a two-parameter constructor that takes an account number and balance. First, implement getters and setters: getNunber(), getBalance(), setBalance (double newBalance) . There is no setNunber() - once an account is created, its account number cannot change. Now implement these methods: void deposit (double anount) and void withdraw(double anount). For both these methods, if the amount is less than zero,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT