cooldude69
Technical User
Here is the actualcode which i am trying to develope<br><br><br>calculation()<br>{<br><br> do<br> {<br> clrscr();<br><br> cout<<"Pleae enter a value for resistance"<<endl;<br> cin>>R;<br><br> while (cin.fail())<br> {<br> cout<<"You have eneter a illegal value please try again"<<endl;<br> cin>>R;<br> }<br><br> cout<<"Pleae enter a value for capacitance"<<endl;<br> cin>>C;<br><br> while (cin.fail())<br> {<br> cout<<"You have eneter a illegal value please try again"<<endl;<br> cin>>C;<br> }<br><br> cout<<"Pleae enter a value for inductance"<<endl;<br> cin>>L;<br><br> while (cin.fail())<br> {<br> cout<<"You have eneter a illegal value please try again"<<endl;<br> cin>>L;<br> }<br><br><br><br> cout<<"========================================================="<<endl;<br> cout<<"You have entered the following values"<<endl;<br> cout<<"Resistance (Ohms) = "<< R <<endl;<br> cout<<"Inductance (Heneries) = "<< L <<endl;<br> cout<<"Capacitance (Farads) = "<< C <<endl;<br> cout<<"========================================================="<<endl;<br> cout<<"The resonant frequency for a series RLC circuit with the"<<endl;<br> W=1/(L*C);<br> cout<<"above component values is W (rads) = "<<W;<br> cout<<" frequency (Hz) = "<< W/(2*3.14)<<endl;<br><br> cout <<"The circuit also has a qualtity factor Q ="<<endl;<br> cin>>quit;<br> }while(quit=='Y');<br><br><br><br> }