Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Kariann Fenoglio
- #include<iostream>
- #include<iomanip>
- #include "Company.h"
- using namespace std;
- int main()
- {
- double sales = 0;
- double product_sales[5] = { 0 };
- Company C;
- int product_no;
- cout << "Enter product number <1-5> <0 to stop>: ";
- cin >> product_no;
- cout << fixed << setprecision(2);
- while (product_no != 0)
- {
- int qty;
- cout << "Enter quantity sold: ";
- cin >> qty;
- sales = C.Calculate(product_no, qty);
- product_sales[product_no - 1] += sales;
- cout << "The sales for this product 1 is $" << sales << endl;
- cout << "\nEnter product number <1-5> <0 to stop>: ";
- cin >> product_no;
- }
- cout << "\nTotal Sales for the week:" << endl;
- cout << "-------------------------" << endl;
- for (int i = 0; i<5; i++)
- cout << "Product " << (i + 1) << ": $" << product_sales[i] << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement