Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST
MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++MUST BE DONE IN C++
2. Write a three-file program based on the following namespace: namespace SALES const int QUARTERS-4,se i it struct Sales double sales[QUARTERS]; double average; double max; double min; Il copies the lesser of 4 or n items from the array ar // to the sales member of s and computes and stores the /ll average, maximum; and minimum values of the entered items; I/ remaining elements of sales, if any, set to 0 void setSales(Sales & s, const double arll, int n); // gathers sales for 4 quarters interactively, stores them // in the sales member of s and computes and stores the //l average, maximum, and minimum values void setSales(Sales & s); // display all information in structure s lv void showSales(const Sales & s); The first file should be a header file that contains the namespace. The second file should be a source code file that extends the namespace to provide definitions for the three prototyped functions. The third file should declare two Sales objects. It should use the interactive version of setSales0 to provide values for one structure and the non- interactive version It should display the contents of both structures by using, showSales0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started