The production of a product requires N process stages from M different machines (N = known, M = known). Each machine can be used more than once for the same product.
For production stage it is known:
- The processing stage code ( integer number in range [1-999] )
- Machine tool code used ( integer number in area [1-9] )
- The stage time, in sec ( integer> 0 )
Write a C language program that will implement the following:
- It will enter data in an array of integers with 3 * N number of positions, based on the N from above. (If the scanf_s command is used, it is necessary to check the validity of values.) It is recommended to use the rand () function properly to avoid the value validity check process.)
- Considering that the order of execution of the processing stages in each machine is determined by the code of the processing stage, with priority low to high :
- Find and display the order of execution of the machining stages on each machine, WITHOUT USING SORTING PROCEDURES! At the same time calculate and display the total working time of each machine process.
Numerical EXAMPLE, N = 8.
The used machine tools (M = 4) are: 2, 5, 7, 9.
MACHINE: 2 | 91, 157, 305 total time: 182
MACHINE: 5 | 72, 773 total time: 159
MACHINE: 7 | 19, 345 total time: 15
MACHINE: 9 | 14 total time: 77