Type: Long Assignment
Code:
LAB211 Assignment LOC: 100
Slot(s): 19
A. Job Description:
ABC Bank needs an application to manage information and transactions of cards issued at the
bank. There are a total of 3 types of cards (Card): CreditCard, DebitCard and AtmCard
- Basic information of any card must have: CardID, CardNumber, DateRelease (issue date),
CardType (card type).
CardType:
1 - CreditCard
2 - DebitCard
3 - AtmCard
- For CreditCard, there is more information: DateValid (card expiration date), AmountDue (card
outstanding balance), AmountMax (card spending limit)
- For DebitCard, there is more information: DateValid, AmountRemaind (the amount in the card)
- For AtmCard, there is more information: Amount (the amount in the card)
- For each type of card, the transaction will have the following information: TransactionID,
CardID (ID of the transaction card), TransactionDate (Transaction date), Money (Transaction
amount), Note (Note if any)
B. Requirements:
I. Requirement 1 (2.5 points):
Students should design and write the program's code to follow the OOP model learned, apply 4
properties: encapsulation, inheritance, polymorphism, abstraction. abstraction).
Note: When designing the code TeamLeader realized that any Card object needs a method
named ShowMe to display the Card's information, this requirement is mandatory for the building
members. Build the code for this program. Please keep this in mind when designing code to
satisfy this requirement.
II. Requirement 2 (2.0 points): Input data for the application.
2.1 Students write a program to input card data and save information about 10 rows into a file. (1
point)
For CreditCard card type, the AmountDue field when entering will have the value 0.
(Candidates only need to enter 1 record information for the examiner, the remaining 9 records
should be generated from the code but must have a full record for the 3 corresponding cards)
2.2 Display all card data in the file (just entered above) to the console screen and sort by
DateRelease ascending, if DateRelease coincides, you can sort by CardID ascending order. (1
point) (Students need to use Collection sort in this function to get points)
III. Requirement 3 (4.5 points):
Write a program to read the card's transaction information file (transaction.txt). The content of
this file, student define their own data to ensure that they meet the requirements below. The order
of fields in this file in the file is as follows: TransactionID, CardID, TransactionDate, Money,
Note Sampe file transaction.txt
Read the file successfully and display successful transaction information (including
TransactionID, CardID, TransactionDate, Money, Note fields) to the console screen (1 point)
3.2 Candidates define the CardException class by themselves, this error will display the
corresponding errors on the screen (Card don't enough money to payment) and the transaction
failure message (1 point)
+ CreditCard: AmountDue + Money cannot be greater than AmountMax
+ DebitCard: AmountRemaind must be greater than Money
+ AtmCard: Amount must be greater than Money
3.3 Customers can create a new transaction, if the transaction is successful, the program will add
it to the file transaction.txt
For the required transaction date (TransactionDate) must be greater than 01/01/1900 and must
be greater than the DateRelease of the card, if it is wrong, it must report an error
TransactionDateException (this exception is defined by the candidate) (0.5 points)
3.4 Errors other than the above 2 errors will be printed on the screen “System error” (0.5 points)
3.5 Update card data for each successful transaction. (1 point)
Each successful transaction of each corresponding card type will change card data in the
database as follows:
+ CreditCard: AmountDue = AmountDue + Money (Transaction)
+ DebitCard: AmountRemaind = AmountRemaind - Money (Transaction)
+ AtmCard: Amount = Amount - Money (Transaction)
III. Requirement 4 (1 point): Display the console screen 3 CardID with the largest total payment
amount (the total payment amount of the card is totaled according to the "Money" field in the
transaction.txt file above) and print out all the corresponding transactions of those CardIDs.
BECAUSE. Requirement 5 (plus points: 1 points):
Statistics print the total transactions with the same date;
Statistics print out 5 transactions with the largest money of the day.
- THE END -