fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class KFZ
  6. {
  7. public:
  8.  
  9. // Konstruktor
  10.  
  11. KFZ(int nTankgr,double nVerbrauch100Km,double nTankinhalt,double nKmStand,double nGewicht):
  12. Tankgr(nTankgr), Verbrauch100Km(nVerbrauch100Km), Tankinhalt(nTankinhalt), KmStand(nKmStand), Gewicht(nGewicht) {}
  13. // Alles Zeigen
  14.  
  15. void Show();
  16.  
  17. private:
  18.  
  19. int Tankgr;
  20. double Verbrauch100Km;
  21. double Tankinhalt;
  22. double KmStand;
  23. double Gewicht;
  24.  
  25. };
  26.  
  27.  
  28. //Show Funktion
  29.  
  30. void KFZ::Show()
  31. {
  32. cout<< "Tankgroeße : "<< Tankgr <<endl;
  33. cout<< "Verbrauch auf 100 Km : "<< Verbrauch100Km <<endl;
  34. cout<< "Tankinhalt zurzeit : "<< Tankinhalt <<endl;
  35. cout<< "Aktueller Km Stand : "<< KmStand <<endl;
  36. cout<< "Zulässiges Gewicht : "<< Gewicht <<endl;
  37.  
  38. }
  39.  
  40.  
  41. int main()
  42. {
  43. KFZ Audi(50,8.7,3.4,5.4,1.0);
  44.  
  45. Audi.Show();
  46.  
  47. return 0;
  48. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
Tankgroeße : 50
Verbrauch auf 100 Km : 8.7
Tankinhalt zurzeit : 3.4
Aktueller Km Stand : 5.4
Zulässiges Gewicht : 1