
Untitled
By: a guest on
May 1st, 2012 | syntax:
Bash | size: 1.38 KB | hits: 12 | expires: Never
void verlauf (Kondensator &C, Spule &L, Widerstand &R, double &dU)
{
vector <double> vzwischenspeicher;
system ("cls");
cout << "Versorgungsspannung: " << dU << "\tVolt" << endl;
cout << "Kondesator: " << C.get_dC () << "\tFarad" << endl;
cout << "Spule: " << L.get_dL () << "\tHenry" << endl;
cout << "Widerstand: " << R.get_dR () << "\tOhm" << endl << endl << endl;
cout << " UR\t IR\t UL\t IL\t UC\t IC\t" << endl << endl;
for (int i = 0; i <= 200; i++)
{
cout.setf(cout.fixed , cout.floatfield); //Gleikommadarstellung
cout.setf(cout.right , cout.adjustfield); //rechtsbündig
cout.setf(cout.precision(2)); //2 Nachkommastellen
cout.setf(cout.showpos); //schreibt '+' vor positive Zahlen
cout.setf(cout.width(6)); //Leerzeichen, so dass jede Zahl 6 Stelln hat --> V bündig
vzwischenspeicher = R.get_vR_spannung();
cout << vzwischenspeicher.at(i) << "V\t";
vzwischenspeicher = R.get_vR_strom();
cout << vzwischenspeicher.at(i) << "A\t";
vzwischenspeicher = L.get_vL_spannung();
cout << vzwischenspeicher.at(i) << "V\t";
vzwischenspeicher = L.get_vL_strom();
cout << vzwischenspeicher.at(i) << "A\t";
vzwischenspeicher = C.get_vC_spannung();
cout << vzwischenspeicher.at (i) << "V\t";
vzwischenspeicher = C.get_vC_strom ();
cout << vzwischenspeicher.at (i) << "A" << endl << endl;
}
}