Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include<iostream> #include<iomanip> using namespace std; int main() { int month

ID: 3620638 • Letter: #

Question

#include<iostream> #include<iomanip>

using namespace std;
int main()
{ int months;
double startBalance; double interestRate; double amountTakenout; double amountDeposit; double monthlyInterest; double totalAmount1; double totalAmount2; double totalAmount3; double endBalance;
cout << "Please enter your starting account balance"; cin >> startBalance;
cout << "Please enter your annual interest rate"; cin >> interestRate;
cout << "Please enter how many months you have had an established account (e.g. 1, 2, etc.)"; cin >> months;
for (int months=1; months<= months;months++); { cout << "Please enter the amount you deposited for each month" << months <<endl; cin >> amountDeposit;
startBalance += amountDeposit; cout << totalAmount1;
cout << "Please enter the amount you withdrew each month" << months << endl;
startBalance -= amountTakenout; cout << totalAmount2;
monthlyInterest = interestRate/12;
totalAmount3 = (monthlyInterest * startBalance) / 100;
endBalance = (startBalance += totalAmount3);
cout << "Your total ending balance is $" << endBalance << endl; cout << "Your total amount of withdrawls was $" << amountTakenout << endl; cout << "Your total amount of deposits was $" << amountDeposit << endl; cout << "The amount of total interest you earned was $" << monthlyInterest << endl;
}
return 0;
}




#include<iostream> #include<iomanip>

using namespace std;
int main()
{ int months;
double startBalance; double interestRate; double amountTakenout; double amountDeposit; double monthlyInterest; double totalAmount1; double totalAmount2; double totalAmount3; double endBalance;
cout << "Please enter your starting account balance"; cin >> startBalance;
cout << "Please enter your annual interest rate"; cin >> interestRate;
cout << "Please enter how many months you have had an established account (e.g. 1, 2, etc.)"; cin >> months;
for (int months=1; months<= months;months++); { cout << "Please enter the amount you deposited for each month" << months <<endl; cin >> amountDeposit;
startBalance += amountDeposit; cout << totalAmount1;
cout << "Please enter the amount you withdrew each month" << months << endl;
startBalance -= amountTakenout; cout << totalAmount2;
monthlyInterest = interestRate/12;
totalAmount3 = (monthlyInterest * startBalance) / 100;
endBalance = (startBalance += totalAmount3);
cout << "Your total ending balance is $" << endBalance << endl; cout << "Your total amount of withdrawls was $" << amountTakenout << endl; cout << "Your total amount of deposits was $" << amountDeposit << endl; cout << "The amount of total interest you earned was $" << monthlyInterest << endl;
}
return 0;
}




#include<iostream> #include<iomanip>

using namespace std;
int main()
{ int months;
double startBalance; double interestRate; double amountTakenout; double amountDeposit; double monthlyInterest; double totalAmount1; double totalAmount2; double totalAmount3; double endBalance;
cout << "Please enter your starting account balance"; cin >> startBalance;
cout << "Please enter your annual interest rate"; cin >> interestRate;
cout << "Please enter how many months you have had an established account (e.g. 1, 2, etc.)"; cin >> months;
for (int months=1; months<= months;months++); { cout << "Please enter the amount you deposited for each month" << months <<endl; cin >> amountDeposit;
startBalance += amountDeposit; cout << totalAmount1;
cout << "Please enter the amount you withdrew each month" << months << endl;
startBalance -= amountTakenout; cout << totalAmount2;
monthlyInterest = interestRate/12;
totalAmount3 = (monthlyInterest * startBalance) / 100;
endBalance = (startBalance += totalAmount3);
cout << "Your total ending balance is $" << endBalance << endl; cout << "Your total amount of withdrawls was $" << amountTakenout << endl; cout << "Your total amount of deposits was $" << amountDeposit << endl; cout << "The amount of total interest you earned was $" << monthlyInterest << endl;
}
return 0;
}




Explanation / Answer

please rate - thanks hope this is what you were looking for your loop was the major problem
you had for (int months=1; months<= months;months++); note the ; and months<=months --always true
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int months,month;
double startBalance;
double interestRate;
double amountTakenout=0;
double amountDeposit=0;
double monthlyInterest=0;
double totalDeposit=0;
double totalTakenout=0;
double totalInterest=0;
double endBalance=0;
cout << "Please enter your starting account balance ";
cin >> startBalance;
cout << "Please enter your annual interest rate ";
cin >> interestRate;
monthlyInterest = interestRate/100./12;
cout << "Please enter how many months you have had an established account (e.g. 1, 2, etc.)";
cin >> months;
for (int month=1; month<= months;month++)
{cout << "Please enter the amount you deposited for month " << month <<endl;
cin >> amountDeposit;
totalDeposit+=amountDeposit;
cout << "Please enter the amount you withdrew month " << month<< endl;
cin>>amountTakenout;
totalTakenout+=amountTakenout;
totalInterest+= (monthlyInterest * startBalance);
}
endBalance=startBalance+totalDeposit-totalTakenout+totalInterest;
cout << "Your total ending balance is $" << endBalance << endl;
cout << "Your total amount of withdrawls was $" << totalTakenout << endl;
cout << "Your total amount of deposits was $" << totalDeposit << endl;
cout << "The amount of total interest you earned was $" << totalInterest << endl;
system("pause");
return 0;
}