Write a program that asks the user to enter the monthly costs for the following expenses incurred from operating his or her automobile: loan payment, insurance, gas, oil, tires, and maintenance. The program should then display the total monthly cost of these expenses, and the total annual cost of these expenses
#include<iostream>
#include<string>
using namespace std;
int main(){
int loanPayment;
int insurancePayment;
int gasPayment;
int oilPayment;
int tirePayment;
int maintenancePayment;
cout <<"Please enter your total monthly loan payment this month: ";
cin >> loanPayment;
cout <<"Please enter your total monthly insurance payment: ";
cin >> insurancePayment;cout <<"Please enter the total monthly cost of gas for your automobile: ";
cin >> gasPayment;
cout<<"Insurance Payment: ";
cin>>insurancePayment;
cout<<"Oil payment: ";
cin>>oilPayment;
cout<<"Tire Payment: ";
cin>>tirePayment;
cout<<"Maintenance Payment: ";
cin>>maintenancePayment;
int totalExpenses =(loanPayment + insurancePayment + gasPayment + oilPayment +tirePayment + maintenancePayment);
int annualExpenses = (totalExpenses * 12);
cout<<"Total Payment motnly: "<<totalExpenses<<endl;
cout<<"annual Expeneses: "<<annualExpenses<<endl;
return 0;
}
Comments
Leave a comment