Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail

Monday, August 27, 2012

BUBTPC 2nd Problem B - Alarm Active in a Chemical Process


Alarm Active in a Chemical Process

Problem Statement:

Two large tanks in a Chemical plant contain different heated liquid. Suppose the names of two tanks are Tank A and Tank B. In order to process safely we need to check the liquid level of Tank A and temperature of Tank B. If the 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 the present level and temperature sensor is used in Tank B to measure the present temperature. An 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. The 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 as input and determine the status of alarm (on or off).  It will also find the percentage (%) of satisfactory level comparing to total sample.

Input:

The first line of input will contain a number N (1<=N<=100), which will denote the number of the sample we want to take. The second line contains the fix liquid level that will be used to compare with other given level of the Tank A. Similarly the third line contains fix temperature that will be used to compare with other given temperature of Tank B.  In 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 the number of time both Tank A and Tank B are satisfactory level. The second line contains the total number of time either any one or both are high (NOT SATISFACTORY level).  The third line shows % of SATISFACTORY and NOT SATISFACTORY level compare to the total sample.

Sample Input/Output:

 Sample input
Sample output
5
40
35
12 45 89 65 10
12 38 35  65 18
SATISFACTORY: 2
NOT SATISFACTORY: 3
SATISFACTORY (%) : NOT SATISFACTORY (%)= 40: 60

Problem setter: Mijanur Rahman, Lecturer, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)

No comments:

Post a Comment

 

Sample text

Sample Text