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

Could somebody convert this \"C++\" programming code into \"C\" programming plea

ID: 3763972 • Letter: C

Question

Could somebody convert this "C++" programming code into "C" programming please ASAP? Thank you!

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include "loan.h"
void welcome()
{
std::cout << "Welcome to Loan Nead Bank "<< std::endl;
std::cout << "" banking needs" << std::endl;
}
std::string getCustomerdetail(std::string& firstname, std::string& lastname)
{
std::string fullastname;
std::cout << "Enter your first name and last name:";
std::cin>>firstname>>lastname;
fullastname =firstname + lastname;
return fullastname;
}
void getLoandetail(double& l_amount, double& ann_IntRate, int& Number_of_Months)
{
std::cout << "Enter the amount that you wish to borrow:" <<std::endl;
std::cin>>l_amount;
std::cout << "Enter the interest rate: ";
std::cin>>ann_IntRate;
std::cout << "Enter the How many months of the loan ";
std::cin>>Number_of_Months;
}
double Mon_InterestRateCalculator(const double ann_IntRate)
{
double M_Int_Rate;
M_Int_Rate = (ann_IntRate/1200);
return M_Int_Rate;
}
double CalculatorMonthlyPmt(double ann_IntRate, const double l_amount, const double M_Int_Rate, const int Number_of_Months)
{
double MonthPmt;
MonthPmt = l_amount * (M_Int_Rate + (M_Int_Rate / (pow(1 + M_Int_Rate, Number_of_Months) - 1)));
return MonthPmt;
}
void TableAmortized(const double l_amount, const double ann_IntRate, const int Number_of_Months)
{
double balance, monthlyPaidInt, MonthPrincipal, M_Int_Rate, MonthPmt;
M_Int_Rate = Mon_InterestRateCalculator(ann_IntRate);
std::cout << "Monthly Interest Rate: " << std::setprecision(4) << M_Int_Rate * 100 << '%' << std::endl;
MonthPmt = CalculatorMonthlyPmt(ann_IntRate, l_amount, M_Int_Rate, Number_of_Months);
std::cout << "Monthly Payment: " << MonthPmt << std::endl;
balance = l_amount;
std::cout <<" Amortized Payment Schedule" <<std::endl;
std::cout << std::setw(6) << std::left << "Month"
<< std::setw(12) << std::left << "Paid Principal"
<< std::setw(14) << std::right << "Paid Interest"
<< std::setw(12) << std::right << "New Balance"
<< std::endl;
for (int i=1; i <= Number_of_Months; i++)
{
monthlyPaidInt = balance * M_Int_Rate;
MonthPrincipal = MonthPmt - monthlyPaidInt;
balance = balance - MonthPrincipal;
std::cout << std::setw(6) << std::left << i
<< std::setw(12) << std::left << std::setprecision(2) << std::fixed << MonthPrincipal
<< std::setw(14) << std::right << std::setprecision(2) << std::fixed << monthlyPaidInt
<< std::setw(14) << std::right << std::setprecision(2) << std::fixed << balance
<< std::endl;
}
}

2nd File:

#include <string>
#ifndef HW_3_HEAD_H
#define HW_3_HEAD_H
void welcome();
std::string getCustomerdetail(std::string&firstname, std::string& lastname);
void getLoandetail(double& l_amount, double& ann_IntRate, int& Number_of_Months);
double Mon_InterestRateCalculator(const double ann_IntRate);
double CalculatorMonthlyPmt(double ann_IntRate, const double l_amount, const double M_Int_Rate, const int Number_of_Months);
void TableAmortized(const double l_amount, const double ann_IntRate, const int Number_of_Months);
#endif

3rd File:

#include <string>
#include "loan.h"
using namespace std;
int main()
{
string firstname, lastname;
double l_amount;
double ann_IntRate, M_Int_Rate=0;
int Number_of_Months;
welcome();
getCustomerdetail(Fname, lastname);
getLoandetail(l_amount, ann_IntRate, Number_of_Months);
TableAmortized(l_amount, ann_IntRate, Number_of_Months);
return 0;
}

Explanation / Answer

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include "loan.h"
void welcome()
{
printf( "Welcome to Loan Nead Bank ")l;
   printf(" banking needs" )l;
}
std::string getCustomerdetail(std::string& firstname, std::string& lastname)
{
std::string fullastname;
printf("Enter your first name and last name:");
scanf(+firstname);

    scanf(+lastname);


fullastname =firstname + lastname;
return fullastname;
}
void getLoandetail(double& l_amount, double& ann_IntRate, int& Number_of_Months)
{
printf("Enter the amount that you wish to borrow:");
   scanf(+l_amount;)
printf("Enter the interest rate: ");
scanf(+ann_IntRate);
printf("Enter the How many months of the loan ");

scanf(+Number_of_Months);
}
double Mon_InterestRateCalculator(const double ann_IntRate)
{
double M_Int_Rate;
M_Int_Rate = (ann_IntRate/1200);
return M_Int_Rate;
}
double CalculatorMonthlyPmt(double ann_IntRate, const double l_amount, const double M_Int_Rate, const int Number_of_Months)
{
double MonthPmt;
MonthPmt = l_amount * (M_Int_Rate + (M_Int_Rate / (pow(1 + M_Int_Rate, Number_of_Months) - 1)));
return MonthPmt;
}
void TableAmortized(const double l_amount, const double ann_IntRate, const int Number_of_Months)
{
double balance, monthlyPaidInt, MonthPrincipal, M_Int_Rate, MonthPmt;
M_Int_Rate = Mon_InterestRateCalculator(ann_IntRate);
std::cout << "Monthly Interest Rate: " << std::setprecision(4) << M_Int_Rate * 100 << '%' << std::endl;
MonthPmt = CalculatorMonthlyPmt(ann_IntRate, l_amount, M_Int_Rate, Number_of_Months);
   printf ("Monthly Payment: " +MonthPmt);
balance = l_amount;
printf(" Amortized Payment Schedule" );
printf("Month");
<printf"(Paid Interest");
   "printf("New Balance");

for (int i=1; i <= Number_of_Months; i++)
{
monthlyPaidInt = balance * M_Int_Rate;
MonthPrincipal = MonthPmt - monthlyPaidInt;
balance = balance - MonthPrincipal;
   prinf(+MonthPrincipal);

      printf(+monthlyPaidInt);
printf(+balance);
  
}
}

2nd File:

#include <string>
#ifndef HW_3_HEAD_H
#define HW_3_HEAD_H
void welcome();
std::string getCustomerdetail(std::string&firstname, std::string& lastname);
void getLoandetail(double& l_amount, double& ann_IntRate, int& Number_of_Months);
double Mon_InterestRateCalculator(const double ann_IntRate);
double CalculatorMonthlyPmt(double ann_IntRate, const double l_amount, const double M_Int_Rate, const int Number_of_Months);
void TableAmortized(const double l_amount, const double ann_IntRate, const int Number_of_Months);
#endif

3rd File:

#include <string>
#include "loan.h"
using namespace std;
int main()
{
string firstname, lastname;
double l_amount;
double ann_IntRate, M_Int_Rate=0;
int Number_of_Months;
welcome();
getCustomerdetail(Fname, lastname);
getLoandetail(l_amount, ann_IntRate, Number_of_Months);
TableAmortized(l_amount, ann_IntRate, Number_of_Months);
return 0;
}