Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1.  
  2.  
  3. #include <iostream>
  4. #include <iomanip>
  5. using namespace std;
  6. int main()
  7.  
  8. {
  9. int rentOrMorgageBill;
  10. int phoneBill;
  11. int utilityBill;
  12. int cableBill;
  13. double monthlyExpense;
  14. double annualExpense;
  15.  
  16.  
  17. cout << "Enter the amount that you pay per month in rent or morgage: $";
  18. cin >> rentOrMorgageBill;
  19.  
  20. cout << "Enter the amount that you pay for your phone per month: $";
  21. cin >> phoneBill;
  22.  
  23. cout << "Enter the amount that you pay for utilities per month: $";
  24. cin >> utilityBill;
  25.  
  26. cout << "Enter the amount that you pay for cable per month: $";
  27. cin >> cableBill;
  28.  
  29. monthlyExpense = rentOrMorgageBill + phoneBill + utilityBill + cableBill;
  30.  
  31. annualExpense = monthlyExpense * 12;
  32.  
  33. cout << " The total monthly housing cost for you is: $" << setprecision(2) << fixed << monthlyExpense << endl;
  34.  
  35. cout << " The total annual housing cost for you is: $" << setprecision(2) << fixed << annualExpense << endl;
  36.  
  37. system("pause");
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement