
Natural Gas Transport Algorithm


A Natural Gas Transmission Pipe (PV) is located along the network control points. At regular intervals, which vary according to the control point, pre-screen checks are carried out to determine the status of the pipeline through metering instruments common to all control points. For each control point the data is:
Control Point Code - Int intent positive integer [1-999] Frequency of proactive controls in days - int integer positive integer [limits 1-365]
State of each of the 10 different measuring instruments of the control point - permissible values 1 or 2 or 3 or 4.
Write a class called checkpoint and private members - data the above data.
In the main () function:
1. set a table of N-class checkpoint objects (N = known, N <= 99) and initialize all table positions using default constructor, setting zero values for all data.
2. Enter the data in the checkpoint object matrix by constructor of the class, using only random numbers, within the limits of values given.
3. Using all the objects in the table:
a. Find and show how many control points each of the measuring instruments is in state 1 (ie 10 values, one for each measuring instrument).
b. Create and display a dynamic table that includes checkpoint codes that have a pre-screening frequency of less than 30 days and at least 5 metering instruments with status 4.
create a descending class named extended_checkpoint that includes additional private members - data:
The cost of preventive testing of each measuring instrument (positive double numbers)
The estimated time of pre-screening of each measuring instrument (positive double numbers)
Then write:
the constructor function for importing data into an object of the extended_checkpoint class using only random numbers and setting the corresponding upper value limits yourself.