Answer to Question #341760 in C++ for saaam

Question #341760

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


1
Expert's answer
2022-05-17T08:56:27-0400


#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;
  }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS