Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

8.) write a c/c+ function called series res that accepts the AC source voltage v

ID: 3796724 • Letter: 8

Question

8.) write a c/c+ function called series res that accepts the AC source voltage v, the loop resistance R, the loop inductance L and the loop capacitance c as inputs for calculating the following parameters (Fo, Q,B,F1, F2, I max, P max) for a series RLC resonant circuit (you may use references or cout statements to print out the function results in the main program) Note you need to change function headline if using references. Double Series res (double R, double L, double C, double v)) Double FO, QB,F1, F2,l max, P max FO 1/(6.28 (sqrt (L C))

Explanation / Answer

#include <iostream>
#include <math.h>
using namespace std;

// function declaration
double series_res(double R, double L, double C,double V);

int main () {
// local variable declaration:
int ch;
double r,l,c,v;
cout<<"Enter your choice- 1. Input from user 2. Take default values"<<endl;
cin>>ch;
switch(ch)
{
case 1:
cout <<"Enter the value of R,L,C and V " ;
cin>>r >>l >>c >>v;

// calling a function series_res.
series_res(r,l,c,v);
break;
case 2:
series_res(100,0.005,0.00000047,120);
break;
default:
cout<<"Invalid option"<<endl;
break;
}

return 0;
}

// function returning the max between two numbers
double series_res(double R, double L, double C,double V) {
// local variable declaration
double FO,Q,B,F1,F2,I_max,P_max;
FO=1/(6.28*(sqrt(L*C)));
Q=6.28*FO*(L/R);
B=FO/Q;
F1=FO-(B/2);
F2=FO+(B/2);
I_max=V/R;
P_max=V*(V/R);

cout << "Value of FO,Q,B,F1,F2,I_max and P_max is : "<<FO<<", "<<Q<<", "<<B<<", "<<F1<<", "<<F2<<", "<<I_max<<", "<<P_max<< endl;

}

//Please mention "w" in the question for table of P vs I

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote