首页 > 编程语言 >C++ Banking System[2022-12-13]

C++ Banking System[2022-12-13]

时间:2022-12-13 10:00:47浏览次数:82  
标签:customer account 12 loan 13 System amount password bank

C++ Banking System[2022-12-13]

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 following 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 in 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. Inquiry
  2. Deposit
  3. Withdraw
  4. Transfer
  5. Loan
  6. Repay
  7. Change password
  8. Quit
    Please select:
  9. Inquiry
    Outputs the balance as follows
    Dear Alita, your balance is 100000.23
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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.
  16. Continue/Quit After each operation, the following menu should be shown and implemented:
  17. Continue //Back to Operation menu
  18. Quit //Terminate the program

源码传送门

传送门:https://pan.baidu.com/s/1JJs9vbZahUCB6cQvXLgAVg?pwd=1111

标签:customer,account,12,loan,13,System,amount,password,bank
From: https://www.cnblogs.com/codewriter/p/16977784.html

相关文章

  • 2022.12.11-2022.12.12 总结
    2022.12.11-2022.12.12总结1.《代码随想录》二刷组合:https://leetcode.cn/problems/combinations/submissions/组合总和III:https://leetcode.cn/problems/combina......
  • Selenium13--模拟键盘操作
    键盘操作概述自动化测试的本质使用程序运行代替对于网页的人工操作。用户在网页上操作时,可能会按下键盘上的各种按键。比如:输入登录账号信息后,直接在文本框里按下键......
  • C++编程题[2022-12-13]
    C++编程题[2022-12-13]题1:采用面向对象的程序设计方法编写一个一卡通管理系统,要求使用多继承、虚函数、虚基类,要有设定类别、计算消费额等功能。题2:定义一个处理时间......
  • 目前(12月13日)我的网站长这样~
    直接上源码:index.html<html> <head> <metacharset="utf-8"> <title>首页-HT</title> <script> window.oncontextmenu=function(e){ e.preventDefault......
  • day3-2022.12.12-flex布局初识
    一、完成以下布局。二、代码如下:<template><div><divclass="title">MYFirstFlexLearn</div><divclass="box"><divclass="item">......
  • Selenium12--元素基本操作
    文本框和文本域点击:click()清空:clear()输入:send_keys("数据")保留原内容,追加输入文本域输入换行时使用转义字符\n来表示获得属性值get_attribut......
  • 20221312 实验七——缓冲区溢出 实验报告
    缓冲区溢出实验指导书内容一、实验简介缓冲区溢出是指程序试图向缓冲区写入超出预分配固定长度数据的情况。这一漏洞可以被恶意用户利用来改变程序的流控制,甚至执行代码......
  • UVA1343 旋转游戏 The Rotation Game
    #include<iostream>#include<string>#include<algorithm>#include<cstring>usingnamespacestd;constintread[25][2]={ {0,0}, {1,3},......
  • day34_0513.找树左下角的值0112.路径总和
    0513.找树左下角的值0112.路径总和【0513.找树左下角的值】一遍acclassSolution{public:intfindBottomLeftValue(TreeNode*root){intresult......
  • 闲话 22.12.12
    闲话?怎么犇犇突然开了?那无耻引流一波(((22.12.11ARC106选做22.12.10[蓝桥杯2021国A]积木题解22.12.9有标号荒漠计数22.12.8流题其一阅读随笔分块指北流题......