subject

You are to write a banking application in c# that keeps track of bank accounts. It will consist of three classes, Account, Bank and BankTest. The Account class is used to represent a savings account in a bank. The class must have the following instance variables:
a String called accountID
a String called accountName
a two-dimensional integer array called deposits (each row represents deposits made in a week). At this point it should not be given any initial value. Each row represents a week and each value in the row represents a deposit amount. Since the number of deposits can be different in each week, this will be a jagged array.
a double called balance, initially set to zero.
The class should have two overloaded constructors:
one takes parameters: accountID of type String and accountName of type String
the other takes parameters: accountID of type String, name of type String, and a two-dimensional integer array (this will be a jagged array).
Methods:
UpdateAccount: when called, simply goes through the deposits array and adds all the deposit amounts to the balance instance variable.
GetDeposits: When called this method will return a string representing the deposit amounts of the array.
ToString: returns a String which represents the ID, the name, the deposits, and the balance of a particular account as shown below. You must use the GetDeposit method in building the string. The output should look as shown below:
ID : 2605
Name :john doe
Deposits : 90 50 70 | 40 50 |
Balance : 300.00
The Bank class is used to keep track of the accounts of the bank. This class does not have a Main method as it is not the one that runs the application. The class must have one instance variable:
A one-dimensional array called accountsArray of type Account (the class Account is defined in the previous question). It will be able to take 10 accounts.
(Note: Feel free to create more instance variables, if there is a need.)
This class will have no constructors.
The class should have a method called AddAccount that takes a new account’s ID, name and a two-dimensional jagged integer array of deposits as parameters. Every time the AddAccount method is called with the appropriate values, it calls the Account constructor and assigns the newly created account to one of the elements of accountsArray. At each successful account addition, the method returns true, else it returns false.
The class should have a method called ApplyDeposits: goes through ONLY the populated elements of accountsArray and applies the deposit amounts (by calling the UpdateAccount method of the Account class).
The class should have a method called ToString. This method goes through the entire accountsArray and calls the ToString method of each element (each account). If the element is not populated, this method writes "No Account Found". Remember, the ToString method returns a string.
The final class, BankTest, will create an object of the Bank class and add ten accounts by calling the AddAccount method on the bank object. After adding the accounts, the test class will call the ApplyDeposits method. Finally, the test class will call the ToString method of the Bank object.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Hassan is writing his master’s thesis, which is a thirty-page document. he received some feedback from his professor in the form of comments, but does not see where the comments are. what is the fastest way for hassan to find the feedback?
Answers: 3
question
Computers and Technology, 22.06.2019 12:00
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
question
Computers and Technology, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
question
Computers and Technology, 23.06.2019 11:50
While preforming before operation pmcs, you notice the front right tire appears slightly under-inflated. what is the proper action?
Answers: 3
You know the right answer?
You are to write a banking application in c# that keeps track of bank accounts. It will consist of t...
Questions
question
Mathematics, 12.02.2021 05:40
question
English, 12.02.2021 05:40
question
Mathematics, 12.02.2021 05:40
question
Mathematics, 12.02.2021 05:40
question
Mathematics, 12.02.2021 05:40
Questions on the website: 13722363