牡丹江网站建设_外贸网站模板_东莞网站建设制作_网站定制

品牌网站设计

石家庄公司网站设计、诸城网站建设、永久使用、不限域名、制作企业网站的公司

揭阳网站制作?

牡丹江网站建设_外贸网站模板_东莞网站建设制作_网站定制

int main() {double principal; // Loan amountdouble annualInterestRate; // Annual interest rate in percentageint years; // Loan term in yearsint repaymentOption; // Repayment option (1 for Equal Principal, 2 for Equal Installments)int frequency; // Repayment frequency (e.g., 12 for monthly, 4 for quarterly, 2 for semi-annually)cout << "Enter the loan amount: ";cin >> principal;if (!validateInput(principal)) {cerr << "Invalid loan amount. Must be greater than zero." << endl;return 1;}cout << "Enter the annual interest rate (in percentage): ";cin >> annualInterestRate;if (!validateInput(annualInterestRate)) {cerr << "Invalid annual interest rate. Must be greater than zero." << endl;return 1;}cout << "Enter the loan term (in years): ";cin >> years;if (!validateInput(years)) {cerr << "Invalid loan term. Must be greater than zero." << endl;return 1;}cout << "Choose repayment option (1 for Equal Principal, 2 for Equal Installments): ";cin >> repaymentOption;if (repaymentOption != 1 && repaymentOption != 2) {cerr << "Invalid option. Choose 1 or 2." << endl;return 1;}cout << "Choose repayment frequency (12 for monthly, 4 for quarterly, 2 for semi-annually): ";cin >> frequency;if (frequency != 12 && frequency != 4 && frequency != 2) {cerr << "Invalid frequency. Choose 12, 4, or 2." << endl;return 1;}double payment;if (repaymentOption == 1) {payment = calculateEqualPrincipalPayment(principal, annualInterestRate, years);cout << "Your average payment (Equal Principal) is: $" << payment << endl;} else if (repaymentOption == 2) {payment = calculateEqualInstallmentsPayment(principal, annualInterestRate, years);cout << "Your monthly payment (Equal Installments) is: $" << payment << endl;}// Calculate total payment and total interestint totalPeriods = years * frequency;double totalPayment = payment * totalPeriods;double totalInterest = totalPayment - principal;cout << "Total payment over the life of the loan: $" << totalPayment << endl;cout << "Total interest paid: $" << totalInterest << endl;// Generate repayment schedulegenerateRepaymentSchedule(principal, annualInterestRate, years, frequency);return 0; 兰州网站制作app开发软件淄博网站制作商业网站模板光谷网站建设镇江网站建设首页制作昭通网站建设公司网站开发河北网站建设济南网站建设镇江网站设计门户网站建设方案校园网站设计企业网站制作定制网站制作公司网站制作品牌公司深圳定制网站制作小企业网页制作哈尔滨网站制作软件外包开发西宁网站建设定制软件开发门户网站建设方案重庆网站建设兰州网站建设定制网站制作公司婚庆公司网站建设东莞个人网站制作辽宁网站建设东莞网页制作设计

猜你喜欢