I need help giving my code a menu. It needs to show a menu inthe beginning of the program where I ca
I need help giving my code a menu. It needs to show a menu inthe beginning of the program where I can have the option to”Process Loan” and “Display Report”. I already have the code doneand it works fine, I just need help setting up a menu. I’m doing aC++ course project and I’m making a financial calculator. Here is my code: #include “stdafx.h”
#include
#include
using namespace std; int main()
{
float loanAmount;
float interestRate;
float monthlyPayment; cout
cin >> loanAmount; cin.ignore();
cout
cin >> interestRate; interestRate /= 100;cin.ignore();
cout
cin >> monthlyPayment; cin.ignore(); while (monthlyPayment
cout
cout
cout
cin >> monthlyPayment;cin.ignore();
} float totalPaid = 0.0f;
float interestToAdd = 0.0f;
int nMonths = 0;
float remaining = loanAmount;
float toAdd = 0.0f;
cout
while (remaining > 0) {
interestToAdd = remaining *interestRate / 12;
nMonths++;
remaining += interestToAdd;
if (remaining > monthlyPayment){
toAdd =monthlyPayment;
}
else {
toAdd =remaining;
}
cout
totalPaid += toAdd;
remaining -= toAdd;
}
cout
cout cout cout cout
cout
cin.ignore();
} Attached