HEP 456 Module 6 Section 14 Communication and Dissemination of The Findings Arizona State University
HEP 456 Module 6 Section 14 Communication and Dissemination of The Findings HEP 456: Health Promotion Program ā¦
CIS 170C
Course project
Week 5
#include < iostream >
#include <string>
#include < cmath >
#include <iomanip> #include <vector> using namespace std;
int main()
{
//Variables
vector<double> lengthOfLoan, amountOfLoan, interestRate;
vector<double> monthlyPayment(100), loanTotal(100), totalInterest(100); char yes;
const int INPUT_CUSTOMER = 1, DISPLAY_LOAN = 2, EXIT_PROGRAM = 3; vector<string> customerName; int choice; int numCustomers = 0; int index = 0; //Program
cout << “Welcome to the Car loan Calculator!\n”
<< “You will be asked to enter the amount of your Car loan,\n”
<< “the interest rate, and lenth you would like your Car loan for.\n”
<< “The program will then tell you your monthly Car payment.\n\n”; do
{ cout << " Car Loan calculator menu:\n\n"
<< “1. Enter customer information\n”
<< “2. See your loan information\n”
<< “3. exit the program\n\n”
<< “Enter a choice: “; cin » choice;
while (choice < INPUT_CUSTOMER || choice > EXIT_PROGRAM)
{ cout << “Please enter a valid menu choice: “; cin » choice;
}
if (choice == 1)
{ cout << “Please enter the number of customers you would
like\n”
<< " to enter loan Car information for: “; cin » numCustomers;
for (index = 0; index < numCustomers; index++)
{ string tempName; double tempAmountOfLoan, tempInterestRate,
tempLengthOfLoan;
cout << “Please enter the customers name: “; cin » tempName;
customerName.push_back(tempName); cout << “Please enter the loan amount: $"; cin » tempAmountOfLoan;
amountOfLoan.push_back(tempAmountOfLoan); cout << “Please enter the interest rate: “; cin » tempInterestRate;
interestRate.push_back(tempInterestRate); cout << “Please enter the length of the Car loan in
months: “; cin » tempLengthOfLoan;
lengthOfLoan.push_back(tempLengthOfLoan);
//Calculations
totalInterest[index] = amountOfLoan[index] *
interestRate[index]; loanTotal[index] = amountOfLoan[index] +
totalInterest[index]; monthlyPayment[index] = loanTotal[index] /
lengthOfLoan[index];
}
}
if (choice == 2) {
//Display monthly payment cout << fixed << setprecision(2);
for (index = 0; index < numCustomers; index++)
{
cout << customerName[index] << " your total loan is $”
<< loanTotal[index] << “\n”
<< “with a monthly Car payment of $” <<
monthlyPayment[index] << “\n”
<< “for " << lengthOfLoan[index] << " months with
an interest\n”
<< “rate of " << interestRate[index] << endl; }
}
} while (choice != EXIT_PROGRAM); system(“pause”);
return 0;
}
HEP 456 Module 6 Section 14 Communication and Dissemination of The Findings HEP 456: Health Promotion Program ā¦
NTR 100 COMPLETE Syllabus and Academic Integrity Acknowledgement Question 1 1 / 1 pts I have read the ASU ā¦
HEP 456 Module 5 Section 12 and 13 Planning for Analysis and Interpretation and Gantt chartĀ Name HEP 456: ā¦