fork download
  1. //OrinTill Qimid CS1A Chapter 3, P. 145, 9
  2. //
  3. /**************************************************************
  4.  * Calculate Automobile Cost
  5.  *
  6.  * ____________________________________________________________
  7.  * This program calculate the cost of any Automobile per month and year based on
  8.  * payment, insurance, gas, oil, maintance per month.
  9.  * ____________________________________________________________
  10.  * INPUT
  11.  * pay : loan payment per month
  12.  * insurance : insurance payed per month.
  13.  * gas : gas payed per month.
  14.  * oil : oil payed per month.
  15.  * tires : money spend on tires per month
  16.  * main : money spend on maintance per month.
  17.  * OUTPUT
  18.  * total_month : total amount of money spend per month
  19.  * total_year : total amount of monery spend yearly.
  20.  **************************************************************/
  21. #include <iostream>
  22. #include <iomanip>
  23. #include <cmath>
  24. using namespace std;
  25.  
  26. int main()
  27. {
  28. float pay,
  29. insurance,
  30. gas,
  31. oil,
  32. tires,
  33. main,
  34. total_month,
  35. total_year;
  36. cout<<"please enter your loan payment amount monthly."<<endl;
  37. cin>> pay;
  38. cout<<"pleasen enter your insurance fee spend monthly."<<endl;
  39. cin>> insurance;
  40. cout<<"please enter how much you spend on gas spend monthly."<<endl;
  41. cin>> gas;
  42. cout<<"Please enter how much you spend on oil per month."<<endl;
  43. cin>>oil;
  44. cout<<"Please enter how much you spend on tires per month"<<endl;
  45. cin>> tires;
  46. cout<<"Please enter how much you spend to maintance your car per month"<< endl;
  47. cin>> main;
  48. total_month = pay + insurance + gas + oil + tires + main;
  49. total_year = total_month * 12;
  50. cout<<"Your spending on your automobile per month is $"<< total_month<<endl;
  51. cout<<"Your spending on your automobile per year is $"<< total_year<<endl;
  52.  
  53.  
  54. return 0;
  55. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty