COMP3153 C++ Programming Language
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
C++ Group Project
C++ Programming Language(COMP3153)
Instructions
Form a team of 3 or 4 students and register it on ispace. The goal is to write a C++ software which follows the specifications detailed below. Note that your C++ code should use classes and inheritance, and that your main function, your class declarations and your class definitions should be written in different files. Submit your C++ program on ispace into one zipped file containing:
D code files (.cpp files and.h files)
>.exe and .txt files
> a brief document containing the User manual of your software, and the job allocation between the team members.
Each group only needs to submit one copy of the zip file. The deadline for the project will be released on ispace.
Description
1.Customer account
In a bank, there are many types of accounts. To make it simple for this course project, we only consider two types of accounts: personal account and enterprise account.
The information about all the accounts of the bank is stored in a text file named account.txt in the following format:
account name password withdrawable category loan amount loan quota left net value
1001
Alita
123456
100000.23
personal
0
20000
100000.23
1002 Naruto 654321 101000.23 enterprise 1000 49000 100000.23
account customer account number. It contains 4 digits and starts from 1001 (the account number 1000 is reserved for the bank manager),
name customer name,
password login password. It must be a 6-digit number only,
withdrawable the amount of money that the customer can withdraw from the bank, category category of customer. Must be either personal or enterprise,
loan amount records the amount that the customer borrows from the bank,
loan quota left the loan quota left for the customer.A personal account can borrow at most 20,000 and an enterprise account can borrow at most 50,000,
net value net value of the account (equal to withdrawable - loan amount ).
For every account, the client can perform the ffollowing
actions: inquire, deposit, withdraw, save, transfer, loan and repay.
inquire When a personal or enterprise account is inquired, the balance of the account is displayed,
deposit A customer can deposit as much as he/she wants and can.After a deposit,the customer's withdrawable,net value and the bank' s total deposits(see the bank manager section below) should be updated,
withdraw For a personal account, the customer can withdraw at most 2000 each time. For an enterprise account, the customer can withdraw at most 5000 each time. If a customer tries to withdraw an amount which exceeds this limit, a warning should be given.When a customer tries to withdraw an amount which exceeds the budget in that account, the withdraw fails and a warning should be given. Once a withdraw is successfully completed, the bank' s total deposits should be updated.
transfer When transferring money, an enterprise account can transfer up to 20,000 while a personal account can transfer at most 10,000 each time. The withdrawable should be updated in the files if the transaction succeeds.
loan The bank offers a loan service to all its customers. The total borrowable amount from the bank is 100,000.Customers can borrow from the bank; if a customer wants to borrow an amount which exceeds the bank' s borrowable amount, a warning message should be given. Once money is loaned, the customer’s withdrawable, loan amount and loan quota left and the bank's borrowable amount should be updated accordingly, and the data file should be updated accordingly as well.
repayment The customer is responsible for repayments. The customer must pay a loan interest rate, equal. to 5% for personal accounts, and 3% for enterprise accounts. For example, if a personal accounts borrows 100 from the bank, the customer should pay back 105 to the bank. Once finishing repayment, the customer's loan amount and loan quota left and the
bank' s borrowable amount and total deposits should be updated accordingly.
change password The customer can change his/her password.
Use Case Demo
When the program starts, it requires the user to input his/her account number and password to log in.
Please input your account number: |
If a valid account can be found in account.txt, the user can proceed to the next step.Otherwise, a warning will be given and the program will go back to the account input.
Please input your account password:
Verify the input using the account' s password stored iin account.txt.If the password does not match, a warning will be given and the program will go back to the account input.
Once logged in successfully, the program should display the following function list:
1 nury 2 epost 3. Withdraw 4 Transfer 5. Loan 6. Repay 7 hange pasword 8. Quit Please select: |
1. Inquiry
Outputs the balance as follows
Dear Alita,your balance is 100000.23 |
2.Deposit
Inputs how much money the customer wants to deposit
Please input the amount to save: 10000 |
Verify if it is a valid amount, and then output the updated balance
Dear Alita,your balance has been updated to 110000.23 |
3. Withdraw
Lets the user withdraw an amount of money
Please input the amount to withdraw: 10000 |
Verify if it is a valid amount, and output the updated balance.Otherwise a warning must be given.
Dear Alita,your balance has been updated to 100000.23 |
4. Transfer
Lets the user transfer money to another account. The customer should input the number of the receiver account
Please input the target account number: 1002 |
Verify if it is a valid account. If not, a warning must be prompted.If yes, let the user input the amount to transfer
Please input the amount to transfer: 10000 |
Verify if it is a valid amount, and output the updated withdrawable amount. Otherwise a warning must be given.
Transfer success!Your withdrawable amount has been updated to 90000.23 |
5. Loan
Lets the customer enter a loan. The user should input the desired amount to borrow.
Please input the loan amount: 1000 |
Verify that the amount is valid.If not, a warning message should be displayed.If yes, output the updated withdrawable and loan quota left entries.
Your withdrawable amount is now 91000.23
Your loan quota left is 19000
6. Repayment
The program will automatically calculate the total amount to repay to the bank according to the customer's loan amount and the bank' s loan interest. Verify if the customer has enough money. If
yes, proceed with the repayment, and output the updated withdrawable amount. Otherwise a
warning should be given. Note that on this example 89950.23 = 91000.23-1000*(1+0.05).After the
customer's repayment, the bank receives 1050 on this example, and the bank' s borrowable amount is increased by that amount.
Cheers!Your loan amount is now 0. Your loan quota is now 20000. Your withdrawable amount has been updated to 89950.23 |
7. Change password
Please input your original password:
After this message, the customer should input his/her original password. If the password is wrong, then the password cannot be changed and a warning message is displayed.If the password is right, the next message below is displayed:
Please input your new password:
Please input your new password again:
The customer is required to input his/her new password twice.If the two passwords don't match, the password is not changed, and a warning message is displayed.If they match, the password is changed and the following message is displayed:
Password updated successfully. |
8. Continue/Quit After each operation, the following menu should be shown and implemented:
1. Continue //Back to Operation menu 2. Quit //Terminate the program |
2. Bank manager account
Note that the account number 1000 is reserved for the bank manager.
The bank manager can log into the system to
> create a customer account,
> check the borrowable amount of the bank,
> check a customer's information (name, withdrawable, category, etc., but not the password) using the customer's account number,
> reset a password for a customer,
The bank' s information is stored in a text file named bank.txt in the following format:
account name password borrowable amount total deposits loan rate personal loan rate enterprise
1000 manager 123456 1000000 200000.46 5% 3%
account Bank manager's account,
name Bank manager's name,
password Login password,
borrowable amount The bank has a limited amount of money to lend,
total depositsT The total amount of deposits in the bank,
loan rate personal The interest rate that personal accounts need to pay on their loans,
loan rate enterprise The interest rate that enterprise accounts need to pay on their loans,
Below is the list of functions available for the bank manager:
1. Create a new account 2 hek te orrwabe amoun of he bnk 3 hek he oa dposits of e ank 4 hek cusomer nomaon 5. Reset password of customer 6. Quit Please select: |
Scenario
1. Create a new account
Please input customer information
(name password withdrawable category)
Input:
123456 100000.23 |
Note that the customers' account numbers start from 1001.Every time a new user account is
created, the new account number is incremented sequentially from the previously created account
(the first customer account has number 1001, the second customer account has number 1002, etc.).
2. Check the borrowable amount of the bank
Display the borrowable amount:
The borrowable amount is 100000 |
3. Check the total deposits of the bank
Display the total deposits of the bank:
The total deposits amount is 200000.46
4. Check customer information
Please input the account number: 1001 |
account
name
withdrawable
category
loan amount
_
loan quota left
net value
1001 Alita 100000.23 personal O 20000 100000.23
5. Reset password of customer
The bank manager can help a customer to reset a forgotten password, using the customer's account number:
Pea npu he accoun numbr 100 Pese npu h ew paword 23987 Pese npu h ew awor gan 2987 Cheers!Password updated! |
2022-12-15