steamengines

problem 9

Oct 2nd, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. //Christian Ballard
  2. //COSC 1330-003
  3. //Problem 9 Calculates the customers bill
  4.  
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     //Decleration section
  11.     int numEnvelopes = 0;
  12.     int numPages = 0;
  13.     double chargeEnvelopes = 0.0;
  14.     double chargePages = 0.0;
  15.     double amntEnvelopes = 0.0;
  16.     double amntPages = 0.0;
  17.     double totalAmnt = 0.0;
  18.  
  19.     //User inputs
  20.     cout << "Enter the amount of envelopes." << endl;
  21.     cin >> numEnvelopes;
  22.     cout << "Enter the amount of pages." << endl;
  23.     cin >> numPages;
  24.     cout << "Enter the charge per envelope." << endl;
  25.     cin >> chargeEnvelopes;
  26.     cout << "Enter the charge per page." << endl;
  27.     cin >> chargePages;
  28.  
  29.     //Calculations
  30.     amntEnvelopes = (numEnvelopes*chargeEnvelopes);
  31.     amntPages = (numPages*chargePages);
  32.     totalAmnt = (amntEnvelopes+amntPages);
  33.  
  34.     //Output
  35.     cout << endl << "Amount due for Envelopes" << endl << amntEnvelopes << endl;
  36.     cout << endl << "Amount due for Pages" << endl << amntPages << endl;
  37.     cout << endl << "Total amount" << endl << totalAmnt << endl;
  38.  
  39.  
  40.  
  41.     system("pause");
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment