By DePaul Dimadis
Choose your prefered Language: greek_flag uk_flag

The production quantity of a product and the quantity of product discarded by the quality control are known for N in a number of hours (N = known). The production unit of the product wants the total rejected quantity not to exceed 20% of the total production quantity for the whole NW time period. However, several events do not allow the production to achieve the desired goal from the first hour of operation. For these reasons, the production manager wants to know the percentage of rejection of current total production for each hour.
Write a program in C language that will implement the following:

  1. Enter in two single-dimensional tables of integer positive N values ​​values ​​related to the production quantity and the corresponding waste quantity for N hours of production. The necessary validity checks must be made at import.
  2. Display on the screen the input values ​​as well as the calculated values ​​given in the example below until the time (if any) in which the total quantity of production disposed is for the first time less than 20% of the total production quantity.
TIME 1 2 3 4 5 6 7 ...
Production 100 150 140 80 110     ...
Current total production 100 250 390 470 580      
Rejected amount 25 45 35 5 3     ...
Current total rejected production 25 70 105 110 113      
percentage rejection % 25 28 27 23 19.5