### calculate the mortgage rate

Hello,

I've been doing this project for my computer science class but there was a problem and I don't know if it's from the server or it's in my code so please help me figure it out.

so this is the question:

 You have been asked to write a program to calculate the mortgage rate for your five clients. The computation process itself can be conveniently done by a web service, as demonstrated by the following code: #include "soapH.h" // include the generated proxy #include #include #include #include "MortgageSoap.nsmap" //include namespace map using namespace std; int main() { struct soap *soap = soap_new(); //new soap instance _ns1__GetMortgagePayment* myData = new _ns1__GetMortgagePayment; //input class instance, determined from mortgage.h _ns1__GetMortgagePaymentResponse* myResult = new _ns1__GetMortgagePaymentResponse; //output class instance int theName;//years double theName2[4];//interest, loan amount, annual tax, annual insurance cout<<"Years: "; cin>>theName; cout<<"Interest: "; cin>>theName2[0]; cout<<"Loan amount: "; cin>>theName2[1]; cout<<"Annual tax: "; cin>>theName2[2]; cout<<"Annual insurance: "; cin>>theName2[3]; myData->Years=theName; myData->Interest=theName2[0]; myData->LoanAmount=theName2[1]; myData->AnnualTax=theName2[2]; myData->AnnualInsurance=theName2[3]; if (soap_call___ns1__GetMortgagePayment(soap, NULL, NULL, myData, myResult) == 0) { //soap method for getting mortgage quote, determined from mortgage.h ns1__MortgageResults* results = new ns1__MortgageResults; results=myResult->GetMortgagePaymentResult; cout<<"\nMonthly principal and interest: "<< results->MonthlyPrincipalAndInterest<<"\n"; cout<<"Monthly tax: "<MonthlyTax<<"\n"; cout<<"Monthly insurance: "<MonthlyInsurance<<"\n"; cout<<"Total payment: "<TotalPayment<<"\n"; } else{ soap_print_fault(soap, stderr); } soap_destroy(soap); //destroy soap instance system("pause"); return 0; } The complete project of the above code is available at VLT (gsoapMortgage.rar). Based on the above code, your program should read in the basic information from keyboard for these five clients, store the information in an array of struct, use the web service to obtain the mortgage result, and print out the mortgage information to computer screen as well as an output data file (mortgage.dat). The struct of client information should contain the following fields: Years (data type: int) Interest (data type: float; unit: percentile) Loan_amount (data type: float; unit: dollar) Annual_tax (data type: float; unit: dollar) Annual_insurance (data type: float; unit: dollar) The name of the above struct is ClientInfo. The detailed information for the five clients is as follows: Client1: Years (30), Interest (4.5), Loan_amount(300000), Annual_tax(3000), Annual_insurance(1000) Client2: Years (15), Interest (4.5), Loan_amount(300000), Annual_tax(3000), Annual_insurance(1000) Client3: Years (30), Interest (3.5), Loan_amount(200000), Annual_tax(2000), Annual_insurance(800) Client4: Years (20), Interest (3.5), Loan_amount(200000), Annual_tax(2000), Annual_insurance(800) Client5: Years (30), Interest (4.5), Loan_amount(180000), Annual_tax(2000), Annual_insurance(700) You should create another struct for mortgage result, which contains the following fields: MonthlyPrincipalAndInterest (data type: float) MonthlyTax (data type: float) MonthlyInsurance (data type: float) TotalPayment (data type: float) The name of the above struct is MortgageResult. The program should have a while loop or a for loop in the main routine to ask users input the client information through keyboard. In this way, the program has a capability of repeatedly asking for the information in each loop until the information of all the five clients is provided.

this is the code I wrote:

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899`` ``````#include "soapH.h" // include the generated proxy #include #include #include #include #include "MortgageSoap.nsmap" //include namespace map using namespace std; struct ClientInfo { int year; float interest; float loan_amount; float annual_tax; float annual_insurance; }; struct MortgageResult { float MonthlyPrincipalAndInterest; float MonthlyTax; float MonthlyInsurance; float TotalPayment; }; int main() { struct soap *soap = soap_new(); //new soap instance _ns1__GetMortgagePayment* myData = new _ns1__GetMortgagePayment; //input class instance, determined from mortgage.h _ns1__GetMortgagePaymentResponse* myResult = new _ns1__GetMortgagePaymentResponse; //output class instance int theName;//years double theName2[4];//interest, loan amount, annual tax, annual insurancefo ofstream OutFile; OutFile.open("mortgage.dat"); ClientInfo x[100]; // store client information MortgageResult y[100]; // store the result of mortgage calculation int num_client=5; // number of clients int i; for(i=0; i> x[i].year; cout << "Interest: "; cin >> x[i].interest; cout << "loan amount: "; cin >> x[i].loan_amount; cout << "Annual tax: "; cin >> x[i].annual_tax; cout << "Annual Insurance: "; cin >> x[i].annual_insurance; } for(i=0; i Years = x[i].year; myData -> Interest = x[i].interest; myData -> LoanAmount = x[i].loan_amount; myData -> AnnualTax = x[i].annual_tax; myData -> AnnualInsurance = x[i].annual_insurance; if (soap_call___ns1__GetMortgagePayment(soap, NULL, NULL, myData, myResult) == 0) { // soap method for ... ns1__MortgageResults* results = new ns1__MortgageResults; results = myResult -> GetMortgagePaymentResult; y[i].MonthlyPrincipalAndInterest = results->MonthlyPrincipalAndInterest; y[i].MonthlyTax = results -> MonthlyTax; y[i].MonthlyInsurance = results -> MonthlyInsurance; y[i].TotalPayment = results -> TotalPayment; OutFile << "Client # is:" << i++ << endl; OutFile << "\n Monthly Principal and Interest: " << y[i].MonthlyPrincipalAndInterest << endl; OutFile << "Monthly Tax: " << y[i].MonthlyTax << endl; OutFile << "Monthly Insurance: " << y[i].MonthlyInsurance << endl; OutFile << "Total Payment: " << y[i].TotalPayment << endl; delete results; } else { soap_print_fault(soap, stderr); // old, KEEP it } } soap_destroy(soap); //destroy soap instance system("pause"); OutFile.close(); return 0; }``````