Advertisement
Guest User

Untitled

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