C++ program Crop damage due to frost is one of the many risks confronting farmer
ID: 3562072 • Letter: C
Question
C++ program Crop damage due to frost is one of the many risks confronting farmers. The figure below shows a simple alarm circuit designed to warn of frost. The alarm circuit uses a device called a thermistor to sound a buzzer when the temperature drops below freezing. Thermistors are semiconductor devices that exhibit a temperature dependent resistance described by the equation R = R0e Beta(1/T ? 1/T0) where R is the resistance, in omega, at the temperature T, in degree K, and R0 is the resistance, in omega, at the temperature To, in degree K. Beta is a constant that depends on the material used to make the thermistor. The circuit is designed so that the alarm will sound when R2 / R+ R2Explanation / Answer
#include <iostream>
#include<math.h>
#define EPSILON 0.0000001
using namespace std;
int main()
{
double r0,r2,r3,r4,t0,beta;
r0=33192;
t0=40+273; //in kelvin
beta=3310;
r2=156300;
r2=r2;
r4=r2;
double T;
cout<<" enter the temeprature (in degree farenheit) : ";
cin>>T;
T=(5/9)*(T-32); // in degree celcius
T=273+T; // in kelvin
double R;
R=r0*exp(beta*((1/T)-(1/t0)));
double a,b;
a=r2/(r2+R);
b=r4/(r3+r4);
if(a<b)
cout<<" the alarm will sound . ";
else
cout<<" the alarm wont sound.";
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.