Question: main.cpp /* CIS 22B: Create and process an array of Sales objects Overloaded stream insertion operator #include Sales.h #include #include #include #include #include using namespace



main.cpp
/* CIS 22B: Create and process an array of Sales objects Overloaded stream insertion operator
#include "Sales.h" #include
const int MAX_SIZE = 30;
/* Write your code here: declare the function you are going to call in this program */
void showReport(string fileName);
int main() { Sales salesArr[MAX_SIZE]; int size = 0; string fileName; cout
return 0; }
/* Write your code here: function definitions */ /* This function receives the name of a file and displays its contents to the screen.
*/ void showReport(string fileName) { fileName.insert(fileName.find("."), "Report"); ifstream in(fileName); if (in.fail()) { cout
Sales.h
/* Specification file for the Sales class - Overloaded stream insertion operator (
#ifndef SALES_H #define SALES_H #include
using std::ostream; using std::string; // ^^^ avoid adding using namespace std;
class Sales { private: /* Write your code here*/ public: // constructors /* Write your code here*/ // setters /* Write your code here*/ // getters /* Write your code here*/ // other functions /* Write your code here*/ // overloaded operators /* Write your code here*/ // Overloaded
#endif
Sales.cpp
/* Implementation file for the Sales class. */
#include "Sales.h" #include
/* Write your code here */
7.15 Lab: Sales Class - Array of Sales objects (overload operators) Reuse the sales class with the following modifications: - Overload the stream insertion operator (
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
