Problem A
Alarm Active in a Chemical Process
Problem Statement:
Two large tanks in a Chemical plant contain different
liquids being heated. Suppose the names of two tanks are Tank A and Tank B. In
order to process safely we need to check the level of Tank A and temperature of
Tank B. If level of Tank A cross a predetermined level or the temperature of
Tank B drops below a prescribed temperature it will be dangerous. For this
purpose Liquid-level sensor is used in Tank A to measure present level and
temperature sensor is used in Tank B to measure the present temperature. For
this purpose industry has decided to design a circuit which will help to know
the present condition of Tank A and Tank B. The circuit will be active when
Liquid level of Tank A cross a predetermined level or the temperature of Tank B
drops below a prescribed temperature or both are true. Circuit will be inactive
(off) when liquid level of Tank A and temperature level of Tank B are
satisfactory. As a programmer you are invited to design a program that will
take different conditions of Tank A and Tank B determine the status of alarm (on
or off). It also find the percentage (%) of satisfactory level compare to total
sample.
Input:
The first line
of input will contain a number N (1<=N<=100), which will denote the
number of sample we want to take. The second line contains the fix liquid level
that will be used to compare with other given level of Tank A. Similarly the
third line contains fix temperature that will be used to compare with other
given temperature. The fourth, you will have to input liquid level at different
times (N different types of value). The fifth line contains values of temperature
at different times.
Output:
In output there
will be three lines. The first line contains number of time both Tank A and
Tank B are satisfactory. The second line contains number of time either any one
or both are high. The third line contains percentage (%) of satisfactory level
compare to total sample.
Sample input
|
Sample output
|
5
50
45
12 45 89 65 10
12 46 45 65 8
|
Normal: 2
Both: 2
Temperature: 0
Pressure: 1
|
problem setter ar name ta dile aro valo hoto...........
ReplyDeleteProblem Setter: Md. Saifur Rahman, Asst. Professor, Dept. of CSE
DeleteBangladesh University of Business and Technology (BUBT)
Sob gula problem ar problem setter ar name thakle valo hoto vai........
Delete