commit df5f01c123d7ddf85739050ec215a65900bc8173 Author: Steffen Vogel Date: Thu Aug 25 14:26:04 2011 +0200 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac50e4f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.metadata/ diff --git a/Aufgabeblock_1/.cproject b/Aufgabeblock_1/.cproject new file mode 100644 index 0000000..f8356ef --- /dev/null +++ b/Aufgabeblock_1/.cproject @@ -0,0 +1,1758 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Aufgabeblock_1/.project b/Aufgabeblock_1/.project new file mode 100644 index 0000000..8a85022 --- /dev/null +++ b/Aufgabeblock_1/.project @@ -0,0 +1,84 @@ + + + Aufgabeblock_1 + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/Aufgabeblock_1/Debug} + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + de.innot.avreclipse.core.avrnature + + diff --git a/Aufgabeblock_1/.settings/de.innot.avreclipse.core.prefs b/Aufgabeblock_1/.settings/de.innot.avreclipse.core.prefs new file mode 100644 index 0000000..107b324 --- /dev/null +++ b/Aufgabeblock_1/.settings/de.innot.avreclipse.core.prefs @@ -0,0 +1,3 @@ +#Thu Aug 18 14:08:19 CEST 2011 +avrtarget/perConfig=false +eclipse.preferences.version=1 diff --git a/Aufgabeblock_1/Debug/Aufgabeblock_1 b/Aufgabeblock_1/Debug/Aufgabeblock_1 new file mode 100755 index 0000000..479e04b Binary files /dev/null and b/Aufgabeblock_1/Debug/Aufgabeblock_1 differ diff --git a/Aufgabeblock_1/Debug/Fahrrad.d b/Aufgabeblock_1/Debug/Fahrrad.d new file mode 100644 index 0000000..74d0de5 --- /dev/null +++ b/Aufgabeblock_1/Debug/Fahrrad.d @@ -0,0 +1,5 @@ +Fahrrad.d Fahrrad.o: ../Fahrrad.cpp ../Fahrrad.h ../Fahrzeug.h + +../Fahrrad.h: + +../Fahrzeug.h: diff --git a/Aufgabeblock_1/Debug/Fahrrad.o b/Aufgabeblock_1/Debug/Fahrrad.o new file mode 100644 index 0000000..d3ee239 Binary files /dev/null and b/Aufgabeblock_1/Debug/Fahrrad.o differ diff --git a/Aufgabeblock_1/Debug/Fahrzeug.d b/Aufgabeblock_1/Debug/Fahrzeug.d new file mode 100644 index 0000000..fd5f746 --- /dev/null +++ b/Aufgabeblock_1/Debug/Fahrzeug.d @@ -0,0 +1,3 @@ +Fahrzeug.d Fahrzeug.o: ../Fahrzeug.cpp ../Fahrzeug.h + +../Fahrzeug.h: diff --git a/Aufgabeblock_1/Debug/Fahrzeug.o b/Aufgabeblock_1/Debug/Fahrzeug.o new file mode 100644 index 0000000..b721a12 Binary files /dev/null and b/Aufgabeblock_1/Debug/Fahrzeug.o differ diff --git a/Aufgabeblock_1/Debug/PKW.d b/Aufgabeblock_1/Debug/PKW.d new file mode 100644 index 0000000..6f5b5bd --- /dev/null +++ b/Aufgabeblock_1/Debug/PKW.d @@ -0,0 +1,5 @@ +PKW.d PKW.o: ../PKW.cpp ../PKW.h ../Fahrzeug.h + +../PKW.h: + +../Fahrzeug.h: diff --git a/Aufgabeblock_1/Debug/PKW.o b/Aufgabeblock_1/Debug/PKW.o new file mode 100644 index 0000000..24edd74 Binary files /dev/null and b/Aufgabeblock_1/Debug/PKW.o differ diff --git a/Aufgabeblock_1/Debug/main.d b/Aufgabeblock_1/Debug/main.d new file mode 100644 index 0000000..edf93e7 --- /dev/null +++ b/Aufgabeblock_1/Debug/main.d @@ -0,0 +1,3 @@ +main.d main.o: ../main.cpp ../Fahrzeug.h + +../Fahrzeug.h: diff --git a/Aufgabeblock_1/Debug/main.o b/Aufgabeblock_1/Debug/main.o new file mode 100644 index 0000000..c074b88 Binary files /dev/null and b/Aufgabeblock_1/Debug/main.o differ diff --git a/Aufgabeblock_1/Debug/makefile b/Aufgabeblock_1/Debug/makefile new file mode 100644 index 0000000..d52f5a7 --- /dev/null +++ b/Aufgabeblock_1/Debug/makefile @@ -0,0 +1,58 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +-include ../makefile.init + +RM := rm -rf + +# All of the sources participating in the build are defined here +-include sources.mk +-include subdir.mk +-include objects.mk + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(strip $(C++_DEPS)),) +-include $(C++_DEPS) +endif +ifneq ($(strip $(C_DEPS)),) +-include $(C_DEPS) +endif +ifneq ($(strip $(CC_DEPS)),) +-include $(CC_DEPS) +endif +ifneq ($(strip $(CPP_DEPS)),) +-include $(CPP_DEPS) +endif +ifneq ($(strip $(CXX_DEPS)),) +-include $(CXX_DEPS) +endif +ifneq ($(strip $(C_UPPER_DEPS)),) +-include $(C_UPPER_DEPS) +endif +endif + +-include ../makefile.defs + +# Add inputs and outputs from these tool invocations to the build variables + +# All Target +all: Aufgabeblock_1 + +# Tool invocations +Aufgabeblock_1: $(OBJS) $(USER_OBJS) + @echo 'Building target: $@' + @echo 'Invoking: GCC C++ Linker' + g++ -o"Aufgabeblock_1" $(OBJS) $(USER_OBJS) $(LIBS) + @echo 'Finished building target: $@' + @echo ' ' + +# Other Targets +clean: + -$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) Aufgabeblock_1 + -@echo ' ' + +.PHONY: all clean dependents +.SECONDARY: + +-include ../makefile.targets diff --git a/Aufgabeblock_1/Debug/objects.mk b/Aufgabeblock_1/Debug/objects.mk new file mode 100644 index 0000000..742c2da --- /dev/null +++ b/Aufgabeblock_1/Debug/objects.mk @@ -0,0 +1,8 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +USER_OBJS := + +LIBS := + diff --git a/Aufgabeblock_1/Debug/sources.mk b/Aufgabeblock_1/Debug/sources.mk new file mode 100644 index 0000000..5b37ead --- /dev/null +++ b/Aufgabeblock_1/Debug/sources.mk @@ -0,0 +1,27 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +O_SRCS := +CPP_SRCS := +C_UPPER_SRCS := +C_SRCS := +S_UPPER_SRCS := +OBJ_SRCS := +ASM_SRCS := +CXX_SRCS := +C++_SRCS := +CC_SRCS := +OBJS := +C++_DEPS := +C_DEPS := +CC_DEPS := +CPP_DEPS := +EXECUTABLES := +CXX_DEPS := +C_UPPER_DEPS := + +# Every subdirectory with source files must be described here +SUBDIRS := \ +. \ + diff --git a/Aufgabeblock_1/Debug/subdir.mk b/Aufgabeblock_1/Debug/subdir.mk new file mode 100644 index 0000000..721404a --- /dev/null +++ b/Aufgabeblock_1/Debug/subdir.mk @@ -0,0 +1,33 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +# Add inputs and outputs from these tool invocations to the build variables +CPP_SRCS += \ +../Fahrrad.cpp \ +../Fahrzeug.cpp \ +../PKW.cpp \ +../main.cpp + +OBJS += \ +./Fahrrad.o \ +./Fahrzeug.o \ +./PKW.o \ +./main.o + +CPP_DEPS += \ +./Fahrrad.d \ +./Fahrzeug.d \ +./PKW.d \ +./main.d + + +# Each subdirectory must supply rules for building sources it contributes +%.o: ../%.cpp + @echo 'Building file: $<' + @echo 'Invoking: GCC C++ Compiler' + g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<" + @echo 'Finished building: $<' + @echo ' ' + + diff --git a/Aufgabeblock_1/Fahrrad.cpp b/Aufgabeblock_1/Fahrrad.cpp new file mode 100644 index 0000000..0752f52 --- /dev/null +++ b/Aufgabeblock_1/Fahrrad.cpp @@ -0,0 +1,40 @@ +/* + * Fahrrad.cpp + * + * Created on: 18.08.2011 + * Author: stv0g + */ + +#include "Fahrrad.h" + +Fahrrad::Fahrrad() { + // TODO Auto-generated constructor stub +} + +Fahrrad::~Fahrrad() { + // TODO Auto-generated destructor stub +} + +double Fahrrad::dGeschwindigkeit() { + double dFahrradGeschwindigkeit = p_dMaxGeschwindigkeit; + int iReduzierung = (int) p_dGesamtStrecke / 20; + + for (int i = 0; i < iReduzierung; i++) { + dFahrradGeschwindigkeit *= 0.9; + } + + if (dFahrradGeschwindigkeit < 12) { + dFahrradGeschwindigkeit = 12; + } + + return dFahrradGeschwindigkeit; +} + +static Fahrrad * Fahrrad::erzeuge(string sName, double dMaxGeschwindigkeit) { + Fahrrad *rad = new Fahrrad(sName); + + rad->p_dMaxGeschwindigkeit = dMaxGeschwindigkeit; + + return rad; +} + diff --git a/Aufgabeblock_1/Fahrrad.h b/Aufgabeblock_1/Fahrrad.h new file mode 100644 index 0000000..a2beba1 --- /dev/null +++ b/Aufgabeblock_1/Fahrrad.h @@ -0,0 +1,26 @@ +/* + * Fahrrad.h + * + * Created on: 18.08.2011 + * Author: stv0g + */ + +#ifndef FAHRRAD_H_ +#define FAHRRAD_H_ + +#include "Fahrzeug.h" + +using namespace std; + +class Fahrrad: public Fahrzeug { +public: + Fahrrad(); + virtual ~Fahrrad(); + + double dGeschwindigkeit(); + void vAusgabe(); + + static Fahrrad * erzeuge(string sName, double dMaxGeschwindigkeit); +}; + +#endif /* FAHRRAD_H_ */ diff --git a/Aufgabeblock_1/Fahrzeug.cpp b/Aufgabeblock_1/Fahrzeug.cpp new file mode 100644 index 0000000..0c4157b --- /dev/null +++ b/Aufgabeblock_1/Fahrzeug.cpp @@ -0,0 +1,63 @@ +/* + * Fahrzeug.cpp + * + * Created on: 18.08.2011 + * Author: stv0g + */ + +#include +#include +#include + +#include "Fahrzeug.h" + +extern double dGlobaleZeit; + +int Fahrzeug::p_iMaxID = 0; + +Fahrzeug::Fahrzeug() { + vInitialisierung(); + //cout << this->p_sName << ":" << this->p_iID << " wurde initialisiert" << endl; +} + +Fahrzeug::Fahrzeug(string sName) { + vInitialisierung(); + p_sName = sName; + + //cout << this->p_sName << ":" << this->p_iID << " wurde initialisiert" << endl; +} + +Fahrzeug::~Fahrzeug() { + //cout << this->p_sName << ":" << this->p_iID << " wurde gelöscht" << endl; +} + +void Fahrzeug::vInitialisierung() { + p_iID = ++p_iMaxID; + + p_sName = " "; + p_dMaxGeschwindigkeit = 0; + p_dGesamtStrecke = 0; + p_dGesamtZeit = 0; + p_dZeit = 0; +} + +void Fahrzeug::vAusgabe() { + cout << setprecision(2) << setiosflags(ios::fixed) + << resetiosflags(ios::right) << setiosflags(ios::left) + << setw(4) << this->p_iID + << setw(7) << this->p_sName << ": " + << resetiosflags(ios::left) << setiosflags(ios::right) + << setw(7) << p_dMaxGeschwindigkeit + << setw(12) << p_dGesamtStrecke + << endl; +} + +void Fahrzeug::vAbfertigung() { + if (fabs(p_dZeit - dGlobaleZeit) < 1e-10) return; + + double dDelta = dGlobaleZeit - p_dZeit; + + p_dGesamtZeit += dDelta; + p_dGesamtStrecke += dGeschwindigkeit() * dDelta; + p_dZeit = dGlobaleZeit; +} diff --git a/Aufgabeblock_1/Fahrzeug.h b/Aufgabeblock_1/Fahrzeug.h new file mode 100644 index 0000000..440bc8b --- /dev/null +++ b/Aufgabeblock_1/Fahrzeug.h @@ -0,0 +1,40 @@ +/* + * Fahrzeug.h + * + * Created on: 18.08.2011 + * Author: stv0g + */ + +#ifndef FAHRZEUG_H_ +#define FAHRZEUG_H_ + +#include + +using namespace std; + +class Fahrzeug { +public: + Fahrzeug(); + Fahrzeug(string sName); + virtual ~Fahrzeug(); + + void vAusgabe(); + virtual void vAbfertigung(); + virtual double dTanken(double dMenge) { return 0; }; /* Kraftfahrzeuge überladen dTanken() */ + virtual double dGeschwindigkeit() { return p_dMaxGeschwindigkeit; } + +protected: + int p_iID; + std::string p_sName; + double p_dMaxGeschwindigkeit; + double p_dGesamtStrecke; + double p_dGesamtZeit; + double p_dZeit; + +private: + static int p_iMaxID; + + void vInitialisierung(); +}; + +#endif /* FAHRZEUG_H_ */ diff --git a/Aufgabeblock_1/PKW.cpp b/Aufgabeblock_1/PKW.cpp new file mode 100644 index 0000000..572c16e --- /dev/null +++ b/Aufgabeblock_1/PKW.cpp @@ -0,0 +1,81 @@ +/* + * PKW.cpp + * + * Created on: 18.08.2011 + * Author: stv0g + */ + +#include +#include + +#include "PKW.h" + +using namespace std; + +extern double dGlobaleZeit; + +PKW::PKW(string sName, double dVerbrauch, double dTankvolumen = 55) : + Fahrzeug(sName), + p_dVerbrauch(dVerbrauch), + p_dTankvolumen(dTankvolumen), + p_dTankinhalt(dTankvolumen/2) { } + +PKW::PKW(double dVerbrauch, double dTankvolumen = 55) : + Fahrzeug(), + p_dVerbrauch(dVerbrauch), + p_dTankvolumen(dTankvolumen), + p_dTankinhalt(dTankvolumen/2) { } + +PKW::~PKW() { + // TODO Auto-generated destructor stub +} + +double PKW::dTanken(double dMenge = 0) { + double dAlterInhalt = p_dTankinhalt; + + if (dMenge == 0) { + p_dTankinhalt = p_dTankvolumen; + } + else { + p_dTankinhalt += dMenge; + if (p_dTankinhalt > p_dTankvolumen) { + p_dTankinhalt = p_dTankvolumen; /* Verhindere Überfüllung */ + } + } + + return p_dTankinhalt - dAlterInhalt; +} + +void PKW::vAbfertigung() { + if (p_dTankinhalt > 0) { /* prüfen, ob etwas im Tank ist */ + p_dTankinhalt -= (dGlobaleZeit - p_dZeit) * p_dMaxGeschwindigkeit * p_dVerbrauch / 100; + if (p_dTankinhalt < 0) { /* falls Tankinhalt negativ ist */ + p_dTankinhalt = 0; + } + Fahrzeug::vAbfertigung(); + } + else { + p_dTankinhalt = 0; + } +} + +void PKW::vAusgabe() { + Fahrzeug::vAusgabe(); + + cout << setprecision(2) << setiosflags(ios::fixed) + << resetiosflags(ios::left) << setiosflags(ios::right) + << setw(7) << dVerbrauch() + << setw(7) << p_dTankinhalt << endl; +} + +double PKW::dVerbrauch() { + return p_dGesamtStrecke * p_dVerbrauch / 100; +} + +static PKW * PKW::erzeuge(string sName, double dMaxGeschwindigkeit) { + Fahrrad *rad = new Fahrrad(sName); + + rad->p_dMaxGeschwindigkeit = dMaxGeschwindigkeit; + + return rad; +} diff --git a/Aufgabeblock_1/PKW.h b/Aufgabeblock_1/PKW.h new file mode 100644 index 0000000..c624a3e --- /dev/null +++ b/Aufgabeblock_1/PKW.h @@ -0,0 +1,34 @@ +/* + * PKW.h + * + * Created on: 18.08.2011 + * Author: stv0g + */ + +#ifndef PKW_H_ +#define PKW_H_ + +#include + +#include "Fahrzeug.h" + +using namespace std; + +class PKW: public Fahrzeug { +private: + double p_dVerbrauch; + double p_dTankinhalt; + double p_dTankvolumen; + +public: + PKW(string sName, double dTankvolumen); + PKW(double dTankvolumen); + virtual ~PKW(); + + void vAbfertigung(); + void vAusgabe(); + double dVerbrauch(); + double dTanken(double dMenge); +}; + +#endif /* PKW_H_ */ diff --git a/Aufgabeblock_1/main.cpp b/Aufgabeblock_1/main.cpp new file mode 100644 index 0000000..a118d65 --- /dev/null +++ b/Aufgabeblock_1/main.cpp @@ -0,0 +1,90 @@ +/* + * main.cpp + * + * Created on: 18.08.2011 + * Author: stv0g + */ + +#include +#include + +#include "Fahrzeug.h" + +using namespace std; + +double dGlobaleZeit = 0.0; + +void vAufgabe1() { + /* 3. Initialisieren */ + Fahrzeug fz1("Porsche"); + Fahrzeug *fz2 = new Fahrzeug(); + + string name; + cout << "Bitte geben Sie einen Fahrzeugnamen ein: "; + cin >> name; + + Fahrzeug *fz3 = new Fahrzeug(name); + + /* 5. Ausgabe */ + cout << endl << "ID Name : MaxKmh GesamtStrecke" << endl; + cout << "++++++++++++++++++++++++++++++++++++++++++" << endl; + fz1.vAusgabe(); + fz2->vAusgabe(); + fz3->vAusgabe(); + + /* 9. Abfertigung */ + double dAbfertigungsIntervall; + cout << endl << "Bitte geben Sie ein Abfertigungsintervall ein: "; + cin >> dAbfertigungsIntervall; + + cout << endl << "ID Name : MaxKmh GesamtStrecke" << endl; + cout << "++++++++++++++++++++++++++++++++++++++++++" << endl; + for (; dGlobaleZeit < 24; dGlobaleZeit += dAbfertigungsIntervall) { /* simuliere für einen Tag */ + fz1.vAbfertigung(); + fz2->vAbfertigung(); + fz3->vAbfertigung(); + + cout << "globale Zeit: " << dGlobaleZeit << endl; + fz1.vAusgabe(); + fz2->vAusgabe(); + fz3->vAusgabe(); + } + + delete fz2; + delete fz3; +} + +void vAufgabe1_deb() { + Fahrzeug fz1("Opel"); + Fahrzeug fz2("Benz"); + Fahrzeug fz3("Ferrari"); + Fahrzeug fz4("Mini"); + + Fahrzeug *feld_name[4] = {&fz1, &fz2, &fz3, &fz4}; + + feld_name[2] = 0; + + for (int i = 0; i < 4; i++) { + feld_name[i]->vAusgabe(); + } +} + +void vAufgabe2() { + int iAnzahl; + vector fahrzeuge; + + cout << "Wie viele Fahrzeuge möchten Sie erstellen? "; + cin >> iAnzahl; + + for (int j = 0; j < i; j++) { + fahrzeuge.push(Fahrrad::erzeuge()); + } +} + +int main() { + //vAufgabe1(); + //vAufgabe1_deb(); + vAugabe2(); + + return 0; +}