A production plant is planning to produce some new products. To choose how many and which of them will eventually start producing has conducted a market survey in 10 different geographical regions for expected sales and expected profits. For each candidate new product (to avoid recurring use of the cin command) the following information - research data is generated through the appropriate use of the rand () function:
- Candidate product code (positive two-digit integer). When it is created it should be checked if it has already been created, and it should be unique.
- Expected sales (in thousands of units) in each of the 10 geographic regions (ten float numbers> 0.0)
- Expected earnings (per thousand units) in each of the 10 geographic regions (ten float numbers> 0.0)
A random dataset could be:
|CODE. PRODUCT||EXPECTED SALES||EXPECTED PROFITS|
|34||1.3 3.3 2.9 5.0 8.5 4.4 2.9 7.9 0.6 6.8||3.2 4.9 1.7 8.0 5.0 6.9 7.7 7.4 7.8 8.0|
The following are required:
- Write a definition of a product-named class that will contain as a private member all the data in a line of the file.
- In the main () function, set an object table of the product class of 20 positions. Each table position corresponds to a prospective new product. Initialize all table positions using default constructor, as above, by default setting zero values for all data.
- Write a constructor of the product class to enter data in the object table of the class.
- In order to enter a candidate new product in the table of objects, you must:
- Have total expected sales in all 10 agglomerations of at least 55.0 (in thousands of pieces) AND
- Have an average expected earnings and in the 10 geographic regions at least 3.0 (per thousand units)
If the above two conditions are not met then the candidate new product code and the average sales in the 10 regions that were generated at the time of importing the data will be assigned respectively to two one-dimensional dynamic tables.
5. Using all objects in the object table to find and display the new product candidate codes with expected sales of at least 7.0 in at least 4 regions
6. Using dynamic datasheets to find and display the new product candidate codes with average sales in the 10 regions larger than 3.5.