Advertisement
InasAwad

Untitled

Jul 18th, 2021
1,628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. void salesSummary() {
  2.     array <array <int, 5>, 4> arr;
  3.     for (int i = 0; i < 4; i++) {
  4.         cout << "Please enter sales for salesman " << i + 1 << endl;
  5.         for (int j = 0; j < 5; j++) {
  6.             cout << "Product " << j + 1 << endl;
  7.             int salesPerDay;
  8.             int productTotalsales = 0;
  9.             for (int k = 0; k < 2; k++) {
  10.                 cout << "Please enter sales for day " << k+1 << endl;
  11.                 cin >> salesPerDay;
  12.                 productTotalsales += salesPerDay;
  13.             }
  14.             arr[i][j] = productTotalsales;
  15.         }
  16.     }
  17.     cout <<"Salesman"<<'\t'<< "product1 " << '\t' << "product2" << '\t' << "product3"
  18.         << '\t' << "product4" <<'\t' << "product5" << endl;
  19.  
  20.     for (int i = 0; i < 4; i++) {
  21.         cout << endl;
  22.         cout << "Salesman " << i+1 << '\t';
  23.         for (int j = 0; j < 5; j++) {
  24.             cout << arr[i][j] << '\t' << '\t';
  25.         }
  26.         cout << endl;
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement