A new bank wants to make a simple application to keep track of all accounts and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A new bank wants to make a simple application to keep track of all accounts and transactions. In this TMA, it is required to help the bank manager implement the required application. Requirements: After a quick meeting with the bank manager, you got the fallowing information: • Itis required to store all bank accounts in one collection and ail the transactions happened in another collection. • Each account has a unique account number, a holder and balance. There is a specific prefix (common for all accounts) that should be added to the holder's civil id to create the unique account number. In addition, it is not allowed for a holder to have more than one account. Furthermore, only three transactions are allowed on any account: deposit, withdrawal and transfer money to another account. • Each holder has a unique civil ID (national id), a name and other attributes (add at least 2 attributes from your choice). • For each transaction, it is required to store the account(s) affected, amount of money, date and if they are successful. There are 3 types of transactions: deposit, withdrawal and transfer. Moreover, you have been informed that the following operations happen frequently: Creating a new account • Deposit money into a specified account • Withdrawal money from a specified account Transfer money between two specified accounts • Printing details of the transaction where the maximum amount of money has been transferred between 2 accounts • Saving all accounts and transactions into a text file. For accounts, they should be sorted in ascending order (according to the civil id) Analysis: Q1: There are common attributes and methods between the three types of transactions, What is the best choice for designing and writing their codes? Explain your answer. Q2: Draw a simple class diagram showing only relationships between the classes. Implementation: After analysing the given requirements, implement the required application: • with Object Oriented Programming style following the rules of good programming style (e.g. adding comments, etc.) using only the material covered in M251 (and its prerequisites) Hints: • For each class, it is required to implement constructors, setters, getters, toStringl) method, and any other necessary method • if the user tries to do an operation that could violate the state of objects, the operation should be ignored and the application should display an error message (e.g. creating an account for the same holder twice, etc.) • Checking equality of any 2 objects should be done via the equals() method • There is a class that will do the main job of the bank as follows: o It has a collection to store the accounts and another one to store the transactions o It has static methods, one for each operation happens frequently o For each operation, a message should be displayed to the user to explain the status of the operation (i.e. if it was successful or not) Testing: After implementing the required classes, design and implement a testing class to test them as follows: • Create at least 3 bank accounts and do some transactions on them • Try to violate the state of the objects and show that your code prevents all violations • Show that the other operations that happen frequently are working fine • At the end, the required data should be stored into a text file and this file should be saved automatically inside the folder contains your lava project A new bank wants to make a simple application to keep track of all accounts and transactions. In this TMA, it is required to help the bank manager implement the required application. Requirements: After a quick meeting with the bank manager, you got the fallowing information: • Itis required to store all bank accounts in one collection and ail the transactions happened in another collection. • Each account has a unique account number, a holder and balance. There is a specific prefix (common for all accounts) that should be added to the holder's civil id to create the unique account number. In addition, it is not allowed for a holder to have more than one account. Furthermore, only three transactions are allowed on any account: deposit, withdrawal and transfer money to another account. • Each holder has a unique civil ID (national id), a name and other attributes (add at least 2 attributes from your choice). • For each transaction, it is required to store the account(s) affected, amount of money, date and if they are successful. There are 3 types of transactions: deposit, withdrawal and transfer. Moreover, you have been informed that the following operations happen frequently: Creating a new account • Deposit money into a specified account • Withdrawal money from a specified account Transfer money between two specified accounts • Printing details of the transaction where the maximum amount of money has been transferred between 2 accounts • Saving all accounts and transactions into a text file. For accounts, they should be sorted in ascending order (according to the civil id) Analysis: Q1: There are common attributes and methods between the three types of transactions, What is the best choice for designing and writing their codes? Explain your answer. Q2: Draw a simple class diagram showing only relationships between the classes. Implementation: After analysing the given requirements, implement the required application: • with Object Oriented Programming style following the rules of good programming style (e.g. adding comments, etc.) using only the material covered in M251 (and its prerequisites) Hints: • For each class, it is required to implement constructors, setters, getters, toStringl) method, and any other necessary method • if the user tries to do an operation that could violate the state of objects, the operation should be ignored and the application should display an error message (e.g. creating an account for the same holder twice, etc.) • Checking equality of any 2 objects should be done via the equals() method • There is a class that will do the main job of the bank as follows: o It has a collection to store the accounts and another one to store the transactions o It has static methods, one for each operation happens frequently o For each operation, a message should be displayed to the user to explain the status of the operation (i.e. if it was successful or not) Testing: After implementing the required classes, design and implement a testing class to test them as follows: • Create at least 3 bank accounts and do some transactions on them • Try to violate the state of the objects and show that your code prevents all violations • Show that the other operations that happen frequently are working fine • At the end, the required data should be stored into a text file and this file should be saved automatically inside the folder contains your lava project
Expert Answer:
Answer rating: 100% (QA)
ANSWER import javaioFileInputStream import javaioFileOutputStream import javaioInputStream import ja... View the full answer
Posted Date:
Students also viewed these programming questions
-
A budding electronics hobbyist wants to make a simple 1.0-nF capacitor for tuning her crystal radio, using two sheets of aluminum foil as plates, with a few sheets of paper between them as a...
-
Sloth Bank wants to make on-line banking easy for its lazy customers, so after a customer signs up and is authenticated by a password, the bank returns a cookie containing a customer ID number. In...
-
Calculate the mass of dry ice that should be added to the water so that the dry ice completely sublimes away when the water reaches 21 C.? Assume no heat loss to the surroundings .
-
Use the data given in Table 3.9 to compute the mean, standard deviation, coefficient of variation, and coefficient of skewness for the current ratio of JNJ. Table 3.9 Year 1990 1991 1992 1993 1994...
-
A quality-assurance inspector periodically examines the output of a machine to determine whether it is properly adjusted. When set properly, the machine produces nails having a mean length of 2.000...
-
The following table shows the prices of a sample of U.S. Treasury strips in August 2009. Each strip makes a single payment of $1,000 at maturity. a. Calculate the annually compounded, spot interest...
-
(a) Use Figure \(7.2 a\) to calculate the \(x\) components of the momenta of the two carts at \(t=30,60\), and \(90 \mathrm{~ms}\). (b) What is the \(x\) component of the momentum of the system at...
-
EZ-Credit, Inc., has $80 million in consumer loans with an average interest rate of 13.5 percent. The bank also has $64 million in home equity loans with an average interest rate of 9 percent....
-
11. Combustion of 1 mole of C6H6(l) inside a closed container of constant volume liberates 900 kJ of heat energy. What would be the value of heat liberated per mole of C6H6(l) if the reaction occurs...
-
For the month of December 2014, Ranger Corporations records show the following information: Cash received on accounts receivable $35,000 Cash sales 30,000 Accounts receivable, December 1, 2014 80,000...
-
KureAll Pharmaceutical Industries, Inc., [KPI] manufactures a wide range of medical products which are distributed world wide. It reported an accounting income before income taxes of $1,875,000 for...
-
Read the article below and answer ALL the questions that follow. Stakeholder Management case study: UK Passport Agency - Why Stakeholder Management is so important Effective Stakeholder Management is...
-
How do evolutionary theories of strategy illuminate the adaptive processes by which organizations explore new opportunities, exploit existing capabilities, and continuously renew their competitive...
-
Walsh corporation has 3 shareholders: X,Y, and Z.X and Y are siblings; Z is unrelated to X and Y. Each shareholder has 200 shares with a basis of $50 per share and have held the stock for 5 years....
-
a A contract is made in Jamaica for the sale of bananas from a farm in Port Antonio packed in crates, CIF to the Port of Liverpool in the UK. In this case, the seller is the shipper, and the seller...
-
Two manufacturing companies (Fuller Industries and Gogul Manufacturing) report the following information. Fuller Industries Gogul Manufacturing ($ in thousands) Sales PPE, net Sales PPE, net Year 6...
-
What would be considered a topic of study in macroeconomics? the effect on Canadian steel producers due to an import quota imposed on foreign steel the effect of an increase in the price of imported...
-
How do the principles of (a) Physical controls and (b) Documentation controls apply to cash disbursements?
-
Grill Master Company sells total outdoor grilling solutions, providing gas and charcoal grills, accessories, and installation services for custom patio grilling stations. Instructions Respond to the...
-
Refer to the revenue arrangement in P18-1. Instructions Consider the following information and respond to the requirements indicated. (a) In response to competitive pressures for the Internet access...
-
Tablet Tailors sells tablet PCs combined with Internet service (Tablet Bundle A) that permits the tablet to connect to the Internet anywhere (set up a Wi-Fi hot spot). The price for the tablet and a...
Study smarter with the SolutionInn App