//Loan Demo Program, Prof Barimani //ProgII class //Translate to C++ // #include #include #include #include using namespace std; int main() { cout<<"Enter Loan Amount? "; double loan; cin>>loan; if (loan <0) cout<<"Loan must be positive\n"; else { cout<<"Enter annual interest Rate%? "; double AIR; cin>>AIR; AIR/=100; if (AIR <0) cout<<"AIR cannot be negative\n"; else { cout<<"1. Month 2. Year? "; string ans; cin>>ans; int month; //should also check to see if Month is positive if (ans == "2") { cout<<"Enter period in Years? "; cin>>month; month*=12; } else { cout<<"Enter period in Month? "; cin>>month; } double MIR= AIR /12.0; double MP= (loan * MIR)/ (1.0- pow(1.0+MIR, -month)); cout<<"Monthly payment= "<