// Nicolas Ruano CS1A Chapter 3, Pp.
/*******************************************************************************
* AUTOMATION COSTS
* ____________________________________________________________________________
* This programs demostrates the mathematical procedure of each cost of the
* Automation costs.
* ____________________________________________________________________________
* MONTHLY EXPENSES
* How much cost for:
* monthly loan
* montly insurance
* monthly gas
* oil
* tires
* monthly maintance
* ____________________________________________________________________________
* CALCULATING THE TOTAL
* totalMonthly = loanPayment + insurance + gas + oil + tires + maintenance;
* totalAnnual = totalMonthly * 12
* ____________________________________________________________________________
* THE RESULTS GIVEN IN THE END
* "\n===== Automobile Expenses Report ====="
* "Total Monthly Cost: $"
* "Total Annual Cost: $"
*******************************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
// Variables for monthly expenses
double loanPayment, insurance, gas, oil, tires, maintenance;
double totalMonthly, totalAnnual;
// Ask the user for each expense
cout << "Enter your monthly loan payment: $";
cin >> loanPayment;
cout << "Enter your monthly insurance cost: $";
cin >> insurance;
cout << "Enter your monthly gas cost: $";
cin >> gas;
cout << "Enter your monthly oil cost: $";
cin >> oil;
cout << "Enter your monthly tires cost: $";
cin >> tires;
cout << "Enter your monthly maintenance cost: $";
cin >> maintenance;
// Calculate totals
totalMonthly = loanPayment + insurance + gas + oil + tires + maintenance;
totalAnnual = totalMonthly * 12;
// Display results
cout << fixed << setprecision(2);
cout << "\n===== Automobile Expenses Report =====" << endl;
cout << "Total Monthly Cost: $" << totalMonthly << endl;
cout << "Total Annual Cost: $" << totalAnnual << endl;
return 0;
}