Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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, showSales0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions