By DePaul Dimadis
Choose your prefered Language: greek_flag uk_flag

A production unit uses 10 maintenance workshops, with codes 1-10, for the maintenance of its machine tools. The unit has a total of 20 machine tools with codes 1-20. The service.txt serial file contains information about the working times of each workshop for one day of the same year. Each workshop is employed only once a day in a machine tool. Each line of the file concerns only one day and includes:
a) the date in HHMM format, int type number
b) the number of garages employed, type int number
(c) in the form of triplets: the workshop code, the machine tool code and the corresponding employment time (in minutes, the int number). (Obviously the maximum number of pairs is 10.)
The file is not calendared and each date only exists once in the archive. B.C. (parentheses are not in the file and listed for your convenience).
1107, 3, (5, 7,100), (4,11,45), (8,13,90)

1405, 1, (7, 10, 80)
2903, 2, (1,4, 120), (9,17,250)
.........
Write a class named repair that will handle the data from the service.txt file. Private data - class data is the data of the file.
The class must contain:

- A constructor for yielding zero values ​​to members of its objects
- A constructor for assigning values ​​from the file read. The data will be serially read from the file (checking for the existence of the file is required).
In the main () function:
1. Declare an object table of the repair class with NN locations (NN = known) and initialize all the positions of the table using the appropriate constructor, by default setting zero values ​​for all data members. The NN value can be smaller, greater or equal to the number of records in the service.txt file. Then enter values ​​in the table objects using the appropriate constructor.
2. Find (if any) the number of lines from the file that are not included in the object table.
3. Using all the objects in the table:
a. Find and display the total time devoted to maintaining each of the machine tools, ie 20 values
b. Find and display the total working time of each workshop for each month of the year for the maintenance of all machine tools, ie a total of 120 prices
4. Create a descending class named new_service, which will include as an additional private member the given cost (positive integer) of maintenance for each workshop and machine tool (ie there will be many costs for each day what workshops employed). Subsequently:
a. Write the constructor function to insert the data into an object of the resulting new_service class.
b. Set a table of objects of the new_service class, size NN = known.
c. Using the resulting class constructor, copy in this new table the data from the repair class object table you created in question 1 by randomly creating valid sums for the new member-given at each position in the new table.