简单银行管理系统

简单银行管理系统

一、内容

用面向对象方法,设计银行现行业务的管理系统。要求但不限于此:

1. 调研现行银行业务流程和规定;

2. 能够模仿学生读书账号的借贷手续、借贷业务和结算业务(贷款loan)

3. 能够完成存款用户的定期存款123年)和活期存款手续,存款业务和结算业务

4. 能够查询某账号下的总资产和明细记录。

5. 能够查询银行的总存款额和总借贷额。

二、设计思路:实现了的功能包括存取款、贷款、查询个人账户信息、查询银行信息、删除用户信息等。客户之间按开户顺序,用链表连接。借贷、存款利率信息查询自网络,根据信息编写公式。查询银行的总存款额和总借贷额,是设了两个全局变量,分别是allBalanceallLoan,每当某个客户存入金额,allBalance加,取款,allBalance减;借贷,allLoan加。




三、程序代码

#include 
#include 
#include 
#include 
#include 
#include using namespace std;float allBalance=0.0;
float allLoan=0.0;class Account { // 银行账户( Account)类
private:int account_Number; // 银行账号char name[10]; // 账户名float Balance; // 账户余额float Loan;
public:Account() { account_Number = 0;name[10] = {'0'};Balance = 0.0;Loan =0.0;} // 构造函数int getNumber() { return account_Number; } // 得到账号信息void openAccount(int number); // 开户void deposit(); // 存款void withdrawal(); // 取款void checkBalance(); // 查询余额void show(); // 显示账号所有信息void loan();// 贷款
};typedef struct Att { // 定义结构体实现链表存储Account A;struct Att *next;
}ATT;void Account::openAccount(int number) { // 开户cout << "Please input your name:" << endl;cin >> name;account_Number = number;Balance = 0;
}
void Account::deposit() { // 存款cout << "Please enter the deposit amount: " << endl;float a;cin >> a;Balance += a;cout<<"1、Time Deposit(定期存款)"<>a;if(a==1){cout<<"Please enter the year: "<>year;switch(year){case 1:Balance =pow(1.015,1)*Balance;allBalance+=Balance;break;case 2:Balance =pow(1.021,2)*Balance;allBalance+=Balance;break;case 3:Balance =pow(1.0275,3)*Balance;allBalance+=Balance;break;}}else if(a==2){cout<<"Please enter the day: "<>day;Balance=(0.0035*day/360)+Balance;allBalance+=Balance;}
}void Account::loan() { // 贷款cout << "Please enter the loan amount: " << endl;float a;cin >> a;Loan += a;cout<<"Loan:"<5      4.90%"<>year;if(year<=1) Loan =pow(1.0435,1)*Loan;else if(year>1&&year<=5) Loan =pow(1.0475,year)*Loan;else Loan =pow(1.0490,year)*Loan;allLoan+=Loan;
}void Account::withdrawal() { // 取款cout << "Your balance is " << Balance <Balance) { cout << "Your balance is insufficient.Please re-enter :" << endl; }cin >> a;} while (a>Balance);Balance -= a;allBalance-=a;
}
void Account::checkBalance() { // 查询余额cout << "The balance of the account is:" << Balance << endl;
}void Account::show() { // 显示账号所有信息cout << "The account number of the bank is :" << account_Number <next = NULL; // 头结点为空(一直都没用)serchp = C;char c = '0', ch, c1;// c 用于判断是否 继续操作(主界面) ch 用于判断选择输入是否正确do {system("cls"); // 清屏menu(); // 显示主界面cin >> ch;while (ch<'0' || ch>'8') {cout << "Incorrect input, please re-enter: " << endl;cin >> ch;getchar();}switch (ch) { // 选择相应的操作case '1': // 开户cout << "Please enter your account number: " << endl;search = serchp->next;do {if (search != NULL) {cout << "The account entered already exists, whether or not to continue typing (y / n)" << endl;cin >> c1;if (c1 == 'n') {break;}else cout << "Please re-enter. " << endl;}cin >> number;search = C->next;while (search != NULL&&number != search->A.getNumber()) {search = search->next;}} while (search != NULL);if (c1 == 'n')break;A = (ATT*)malloc(sizeof(ATT)); // 申请新结点A->A.openAccount(number);A->next = NULL;serchp->next = A; // 将新结点插入链尾serchp = serchp->next;break;case '2': // 存款cout << "Please enter your account number: " << endl;search = C;do {if (search == NULL) {cout << "The account does not exist, whether or not to continue typing (y / n)" << endl;cin >> c1;if (c1 == 'n') {break;}else cout << "Please re-enter" << endl;}cin >> number;search = C->next;while (search != NULL&&number != search->A.getNumber()) {search = search->next;}} while (search == NULL);if (c1 == 'n')break;search->A.deposit();break;case '3': // 取款cout << "Please enter the withdrawal account: " << endl;search = C;do {if (search == NULL) {cout << "The account does not exist, whether or not to continue typing (y / n)" << endl;cin >> c1;if (c1 == 'n') {break;}else cout << "Please re-enter" << endl;}cin >> number;search = C->next;while (search != NULL&&number != search->A.getNumber()) {search = search->next;}} while (search == NULL);if (c1 == 'n')break;search->A.withdrawal();break;case '4': // 查询余额cout << "Please enter your bank account: " << endl;search = C;do {if (search == NULL) {cout << "The account does not exist, whether or not to continue typing (y / n)" << endl;cin >> c1;if (c1 == 'n') {break;}else cout << "Please re-enter" << endl;}cin >> number;search = C->next;while (search != NULL&&number != search->A.getNumber()) {search = search->next;}} while (search == NULL);if (c1 == 'n')break;search->A.checkBalance();break;case '5':cout << "Please enter your bank account: " << endl;search = C;do {if (search == NULL) {cout << "The account does not exist, whether or not to continue typing (y / n)" << endl;cin >> c1;if (c1 == 'n') {break;}else cout << "Please re-enter" << endl;}cin >> number;search = C->next;while (search != NULL&&number != search->A.getNumber()) {search = search->next;}} while (search == NULL);if (c1 == 'n')break;search->A.show();break;case '6': // 注销账号cout << "Please enter your bank account: " << endl;search = C;fp = C;do {if (search == NULL) {cout << "The account does not exist, whether or not to continue typing (y / n)" << endl;cin >> c1;if (c1 == 'n') {break;}else cout << "Please re-enter" << endl;}cin >> number;search = C->next;while (search != NULL&&number != search->A.getNumber()) {fp = search;search = search->next;}} while (search == NULL);if (c1 == 'n')break;fp->next = search->next;cout << "The user " << search->A.getNumber() << " has been deleted. " << endl;free(search);break;case '7': // 贷款cout << "Please enter your account number: " << endl;search = C;do {if (search == NULL) {cout << "The account does not exist, whether or not to continue typing (y / n)" << endl;cin >> c1;if (c1 == 'n') {break;}else cout << "Please re-enter" << endl;}cin >> number;search = C->next;while (search != NULL&&number != search->A.getNumber()) {search = search->next;}} while (search == NULL);if (c1 == 'n')break;search->A.loan();break;case '8':getBank();break;case '0': // 退出系统cout << "Thank you for your use! Goodbye." << endl;c = 'n';break;}if (c != 'n') {cout << "Do you continue, y/n" << endl;cin >> c;}} while (c == 'y' || c == 'Y');
}
int main() {fun();return 0;
}


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部