且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

需要帮助来读取文件并整齐显示.

更新时间:2023-11-25 14:10:28

"<< endl; cin>> accountOne.acc_Balance; 同时(accountOne.acc_Balance< = 0 )// 检查余额是否为负值 { cout<< " << endl; 返回 0 ; } cout<< "
"<<endl; cin >> accountOne.acc_Balance; while(accountOne.acc_Balance<=0) //checking the balance for negative values { cout<<"Account balance cannot be a negative!"<<endl; return 0; } cout << "Enter bank account balance of Account Two:


" &lt ;< endl; cin>> accountTwo.acc_Balance; 同时(accountTwo.acc_Balance< 0) { cout<< " << endl; 返回 0 ; } cout<< " << endl; cin>> accountOne.ann_InterestRate; 同时(accountOne.ann_InterestRate< 0 || accountOne.ann_InterestRate> 0. 15 ) { cout<< " << endl; cout<< " << endl; cin>> accountOne.ann_InterestRate; } cout<< " << endl; cin>> accountTwo.ann_InterestRate; 同时(accountTwo.ann_InterestRate< 0 || accountTwo.ann_InterestRate> 0. 15 ) { cout<< " << endl; cout<< " << endl; cin>> accountTwo.ann_InterestRate; } // 提示输入要保留的现金的期限 cout<< " << endl; cin> term; 同时(term< 1 || term> 10) { cout<< " << endl; cout<< " ; cin> term; } // 提示用户输入自动存款金额 cout<< "
"<<endl; cin >> accountTwo.acc_Balance; while(accountTwo.acc_Balance<0) { cout<<"Account balance cannot be a negative !"<<endl; return 0; } cout<<"Enter the annual interest rate for Account One: "<<endl; cin>>accountOne.ann_InterestRate; while(accountOne.ann_InterestRate<0 || accountOne.ann_InterestRate>0.15) { cout<<"The annual interest rate must be between 0 and 0.15"<<endl; cout<<"Enter interest rate again: "<<endl; cin>>accountOne.ann_InterestRate; } cout<<"Enter the annual interest rate for the second account: "<<endl; cin>>accountTwo.ann_InterestRate; while(accountTwo.ann_InterestRate<0 || accountTwo.ann_InterestRate>0.15) { cout<<"The annual interest rate must be between 0 and 0.15"<<endl; cout<<"Enter interest rate again: "<<endl; cin>>accountTwo.ann_InterestRate; } //prompt to enter a term for the cash to be held cout<<"Enter the term the accounts will be held: "<<endl; cin>>term; while(term<1 || term>10) { cout<<"The term has to be between 1 to 10 years"<<endl; cout<<"Re-enter the term: "; cin>>term; } //prompt the user for an automatic deposit amount cout<<"Enter a deposit amount per month:


" << endl; cin> depositAmount; // 提示用户提款金额 cout<< "
"<<endl; cin>>depositAmount; //prompt the user for a withdrawal amount cout<<"Enter a withdrawal amount per month: