Write a C+ function called Series_ Res that calculates the resonant frequency W0
ID: 2080455 • Letter: W
Question
Write a C+ function called Series_ Res that calculates the resonant frequency W0, the bandwidth BW, the quality factor Q and maximum output power Pmax for an input resistance R(in Ohms), inductance L (in Henries), capacitance C (in farads ) and voltage V (in Volts). Use reference in your function headline to return the calculated outputs W0, BW, Q and Pmax to return the results of the function to the main program. Use the following formulas in your function: W0 = 1/sqrt (L*C); Q = W0*L/R; BW = W0/Q Pmax = V*V/R; Float Series_ Res (float R, float L, float C, float V, ???? ) } ??????? } After writing your function, use it in a main program that accepts the following input values: R = 660 Ohms L = 0.015 Henries C = 0.000000185 Farads V = 15 Volts And use reference with cout statements in the main program to get a print out of your results.Explanation / Answer
(C++ Code)
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
float R, L, C, V, W0, Q, BW, Pmax;
R = 660;
L = 0.015;
C = 0.000000185;
V = 15;
void Series_res(float R, float L, float C, float V, float& W0, float& Q, float& BW, float& Pmax);
Series_res(R,L,C,V,W0,Q,BW,Pmax);
cout << "Resonant Frequency = " << *(&W0) << endl;
cout << "Quality factor = " << *(&Q) << endl;
cout << "Bandwidth = " << *(&BW) << endl;
cout << "Maximum Output Power = " << *(&Pmax) << endl;
}
void Series_res(float R, float L, float C, float V, float& W0, float& Q, float& BW, float& Pmax)
{
W0 = 1/sqrt(L*C);
Q = (W0*L)/R;
BW = W0/Q;
Pmax = V*V/R;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.