A gas pipeline network supplies high-pressure installations and medium pressure installations. There are a total of 5 high pressure installations and 5 medium pressure installations. A gas.txt serial file contains data about transport quantities for each day.Each line of the file contains the following information:
- Date in HHMM format where HH = day [1.30] and MM = month [1.12]
- Type of installation (0 = high pressure, 1 = medium pressure)
- Supply quantity in m3 for each plant (five float numbers,> = 0.0) A random line of the file is as follows (the headings are not in the file):
|TYPE OF INSTALLATION||QUANTITY|
|1405||1||17.2 16.9 25.7 8.0 27.7|
The following are required:
- Write a definition of a station-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 N station class (N = known). Initialize all table positions using default constructor, as above, by default setting zero values for all data.
- Write a constructor of the class class to enter data in the object table of the class. The data will be serially read from the file (checking for the existence of the file is required).
- To insert a line of the file into the object table, the total quantity for all 5 installations must be> = 10.0. If the total number of lines of the gas.txt file to be entered in the table is greater than N then for the lines that meet the above limitation and will not be entered in the table: the type of installation and the corresponding total quantity for all 5 installations will be assigned respectively to two one-dimensional dynamic tables.
- Using all table objects to find and display the total quantities per month and type of installation (ie a total of 24 values, 12 for high pressure and 12 for average pressure).
- Using the dynamic datasheets to find the total quantities entered for each type of plant (ie two final sets of quantities).(NOTE: as many functions as members of the station class are required when developing the program can be written at any point using the appropriate notations)Create a descending class named new_station that includes additional private members - data:
- The cost of running each facility for that date (five float values> = 0.0)Then write:
The constructor function to insert the data into an object of the new_station class WITH THE NECESSARY VALIDATION CONTROL.