Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Christian Ballard
- //COSC 1330-003
- //Problem 9 Calculates the customers bill
- #include <iostream>
- using namespace std;
- int main()
- {
- //Decleration section
- int numEnvelopes = 0;
- int numPages = 0;
- double chargeEnvelopes = 0.0;
- double chargePages = 0.0;
- double amntEnvelopes = 0.0;
- double amntPages = 0.0;
- double totalAmnt = 0.0;
- //User inputs
- cout << "Enter the amount of envelopes." << endl;
- cin >> numEnvelopes;
- cout << "Enter the amount of pages." << endl;
- cin >> numPages;
- cout << "Enter the charge per envelope." << endl;
- cin >> chargeEnvelopes;
- cout << "Enter the charge per page." << endl;
- cin >> chargePages;
- //Calculations
- amntEnvelopes = (numEnvelopes*chargeEnvelopes);
- amntPages = (numPages*chargePages);
- totalAmnt = (amntEnvelopes+amntPages);
- //Output
- cout << endl << "Amount due for Envelopes" << endl << amntEnvelopes << endl;
- cout << endl << "Amount due for Pages" << endl << amntPages << endl;
- cout << endl << "Total amount" << endl << totalAmnt << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment