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 following information:  It is required to store all bank accounts in one collection and all 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)       2

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Overview:
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 following information:
 It is required to store all bank accounts in one collection and all 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)
      2

Hints:
 For each class, it is required to implement constructors, setters, getters, toString() 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 Java project

Name of Student:
Signature:
Date:
1
Overview:
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 following information:
It is required to store all bank accounts in one collection and all 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 ac
Deposit money into a specified account
Withdrawal money from a specified account
Transfer money between two specified accounts
unt
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)
2
Hints:
For each class, it is required to implement constructors, setters, getters, toString() method.
Transcribed Image Text:Name of Student: Signature: Date: 1 Overview: 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 following information: It is required to store all bank accounts in one collection and all 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 ac Deposit money into a specified account Withdrawal money from a specified account Transfer money between two specified accounts unt 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) 2 Hints: For each class, it is required to implement constructors, setters, getters, toString() method.
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
into a specified account
hey from a specified account
Transter money between two specified accounts
3 of 3
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)
2
Hints:
For each class, it is required to implement constructors, setters, getters, toString() 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:
It has a collection to store the accounts and another one to store the transactions
It has static methods, one for each operation happens frequently
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 Java project
Marks distribution:
22 marks for the essential classes
23 marks for the class represents Account
37 marks for the class that will do the main job
9 marks for the testing class
3 marks for following the given instructions
6 marks for answering the two questions
Important notes on penalties:
Transcribed Image Text: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 into a specified account hey from a specified account Transter money between two specified accounts 3 of 3 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) 2 Hints: For each class, it is required to implement constructors, setters, getters, toString() 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: It has a collection to store the accounts and another one to store the transactions It has static methods, one for each operation happens frequently 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 Java project Marks distribution: 22 marks for the essential classes 23 marks for the class represents Account 37 marks for the class that will do the main job 9 marks for the testing class 3 marks for following the given instructions 6 marks for answering the two questions Important notes on penalties:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Running Time of Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education