Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: Bash  |  size: 1.38 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void verlauf (Kondensator &C, Spule &L, Widerstand &R, double &dU)
  2. {
  3.         vector <double> vzwischenspeicher;
  4.  
  5.         system ("cls");
  6.  
  7.         cout << "Versorgungsspannung:   " << dU << "\tVolt" << endl;
  8.         cout << "Kondesator:            " << C.get_dC () << "\tFarad" << endl;
  9.         cout << "Spule:                 " << L.get_dL () << "\tHenry" << endl;
  10.         cout << "Widerstand:            " << R.get_dR () << "\tOhm" << endl << endl << endl;
  11.  
  12.         cout << " UR\t IR\t UL\t IL\t UC\t IC\t" << endl << endl;
  13.        
  14.        
  15.         for (int i = 0; i <= 200; i++)
  16.         {
  17.                 cout.setf(cout.fixed , cout.floatfield);                //Gleikommadarstellung
  18.                 cout.setf(cout.right , cout.adjustfield);               //rechtsbündig
  19.                 cout.setf(cout.precision(2));                                   //2 Nachkommastellen
  20.                 cout.setf(cout.showpos);                                                //schreibt '+' vor positive Zahlen
  21.                 cout.setf(cout.width(6));                                               //Leerzeichen, so dass jede Zahl 6 Stelln hat --> V bündig
  22.  
  23.  
  24.                 vzwischenspeicher = R.get_vR_spannung();
  25.                 cout << vzwischenspeicher.at(i) << "V\t";
  26.  
  27.                 vzwischenspeicher = R.get_vR_strom();
  28.                 cout << vzwischenspeicher.at(i) << "A\t";
  29.  
  30.                 vzwischenspeicher = L.get_vL_spannung();
  31.                 cout << vzwischenspeicher.at(i) << "V\t";
  32.  
  33.                 vzwischenspeicher = L.get_vL_strom();
  34.                 cout << vzwischenspeicher.at(i) << "A\t";
  35.  
  36.                                
  37.                 vzwischenspeicher = C.get_vC_spannung();
  38.                 cout << vzwischenspeicher.at (i) << "V\t";
  39.  
  40.                 vzwischenspeicher = C.get_vC_strom ();
  41.                 cout << vzwischenspeicher.at (i) << "A" << endl << endl;
  42.                
  43.         }
  44. }