Question

In: Computer Science

Consider a nuclear reactor whose temperature is monitored by three sensors. An alarm should go off...

Consider a nuclear reactor whose temperature is monitored by three sensors. An alarm should go off if any two of the sensor readings disagree by more than 5°F. Write a program that would print a string ‘ALARM’ if any two temperate readings disagree by strictly more than 5°F and ‘NORMAL’ otherwise

Ask for each temperature input and display the state

Use MATLAB

Solutions

Expert Solution

Please let me know if anything is required. Follow the indentation as shown in screenshot.

Code:

printf("Enter Three Temperatures in farenheit : \n")
prompt = ''; %taking the temperature inputs from the user
x1 = input(prompt)
x2 = input(prompt)
x3 = input(prompt)


%conditions for the Alarm if any two temperate readings disagree by strictly more than 5°F
if( (x1 > 5) && (x2 >5))
    printf("ALARM\n")
elseif ((x1 > 5) &&(x3 > 5))
    printf("ALARM\n")
elseif((x2 > 5) && (x3 > 5))
    printf("ALARM\n")
else
    printf("NORMAL\n") %‘NORMAL’ otherwise
end

Code :

TestCase 1 :

TestCase 2 :

TestCase 3 :


Related Solutions

Use the diagram of the nuclear reactor to answer the three questions below.  Which component acts...
Use the diagram of the nuclear reactor to answer the three questions below.  Which component acts as a source of heat energy to produce steam? Based on the components that are present in the diagram, what type of nuclear power plant is this? The reaction rate can be controlled using fuel rods and control rods. In order to increase heat, which of the following should be done? Control rods should be lifted out of the fuel rods so that less...
1. Consider a blackbody at temperature T=1000K. (c) This particular blackbody is a hollow cube, whose...
1. Consider a blackbody at temperature T=1000K. (c) This particular blackbody is a hollow cube, whose side measures L meters. Write an expression for the wavelengths of radiation allowed in this blackbody. (d) What is the energy spacing between energy levels of a mode with wavelength λ = 100nm? (e) Calculate the approximate average energy in this mode at temperature T = 10000K (f) What was the (incorrect) assumption in the classical treatment of blackbody radiation? Contrast it to your...
Consider a completely miscible two-component system whose overall composition is X, at a temperature where liquid...
Consider a completely miscible two-component system whose overall composition is X, at a temperature where liquid and gas phases coexist. The composition of the gas phase at this temperature is Xa and the composition of the liquid phase is Xb. Prove the lever rule, which says that the proportion of liquid to gas is (X -Xa)/(Xb -X). Interpret this rule graphically on a phase diagram.
What issues should executives of a company such as Blue Apron consider before deciding to go...
What issues should executives of a company such as Blue Apron consider before deciding to go public? In your opinion, was the company ready for an IPO? Why or why not?
You are deciding if you should go to Law School, which is a three year degree....
You are deciding if you should go to Law School, which is a three year degree. If you do not go to law school, you will earn $47,000 per year. While you are in law school, you will have the opportunity to take a part-time job working for a professor for $12,000 per year. Tuition is $30,000 per year. Once you get a law degree, you will earn $100,000 per year. For simplicity, assume no raises. a) Suppose the interest...
What are the three factors a manager should consider in controlling stockouts?
What are the three factors a manager should consider in controlling stockouts?
13) Consider three balloons, all the same size, at the same temperature and pressure. One is...
13) Consider three balloons, all the same size, at the same temperature and pressure. One is filled with hydrogen, one with CO2, and one with nitrogen. a) which balloon has the greatest density? why? b) which balloon contains the most molecules? why? c) Which balloon contains the most atoms? why? d) which balloon contains the fastest moving molecules? why? e) which balloon contains the molecules that would effuse the slowest? why?
Consider three engines that each use 2160 J of heat from a hot reservoir (temperature =...
Consider three engines that each use 2160 J of heat from a hot reservoir (temperature = 540 K). These three engines reject heat to a cold reservoir (temperature = 335 K). Engine I rejects 1497 J of heat. Engine II rejects 655 J of heat. Engine III rejects 1340 J of heat. One of the engines operates reversibly, and two operate irreversibly. However, of the two irreversible engines, one violates the second law of thermodynamics and could not exist. For...
Consider three engines that each use 1695 J of heat from a hot reservoir (temperature =...
Consider three engines that each use 1695 J of heat from a hot reservoir (temperature = 565 K). These three engines reject heat to a cold reservoir (temperature = 325 K). Engine I rejects 975 J of heat. Engine II rejects 655 J of heat. Engine III rejects 1108 J of heat. One of the engines operates reversibly, and two operate irreversibly. However, of the two irreversible engines, one violates the second law of thermodynamics and could not exist. For...
Consider the reaction A+2B⇌C whose rate at 25 ∘C was measured using three different sets of...
Consider the reaction A+2B⇌C whose rate at 25 ∘C was measured using three different sets of initial concentrations as listed in the following table: TRIAL [A] (M) [B] (M) RATE (M/s) 1 .50 .30 9.0x10^-3 2 .50 .60 1.8x10^-2 3 .100 .30 3.6x10^-2 What is the rate law for this reaction? Express the rate law symbolically in terms of k, [A], and [B].
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT