rendered paste body#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
float Addition() {
float Zahl;
float Ergebnis;
string Option("ja");
do {
cout<<"Zahl eingeben"<<endl;
cin>>Zahl;
cout<<"Zahl eingeben"<<endl;
cin>>Ergebnis;
Ergebnis=Ergebnis+Zahl;
cout<<" = "<<Ergebnis<<endl;
cout<<""<<endl;
cout<<"Weiterrechnen?(ja/nein)"<<endl;
cin>>Option;
}
while(Option=="ja");
}
float Subtraktion() {
float Zahl1;
float Zahl2;
string Option("ja");
cout<<"Zahl eingeben"<<endl;
cin>>Zahl2;
do {
cout<<"Zahl eingeben"<<endl;
cin>>Zahl1;
Zahl2=Zahl2-Zahl1;
cout<<" = "<<Zahl2<<endl;
cout<<""<<endl;
cout<<"Weiterrechnen?(ja/nein)"<<endl;
cin>>Option;
}
while(Option=="ja");
}
float Multiplikation() {
float Zahl1;
float Zahl2;
string Option("ja");
cout<<"Zahl eingeben"<<endl;
cin>>Zahl2;
do {
cout<<"Zahl eingeben"<<endl;
cin>>Zahl1;
Zahl2=Zahl2*Zahl1;
cout<<" = "<<Zahl2<<endl;
cout<<""<<endl;
cout<<"Weiterrechnen?(ja/nein)"<<endl;
cin>>Option;
}
while(Option=="ja");
}
float Division() {
float Zahl1;
float Zahl2;
string Option("ja");
cout<<"Zahl eingeben"<<endl;
cin>>Zahl2;
do {
cout<<"Zahl eingeben"<<endl;
cin>>Zahl1;
Zahl2=Zahl2/Zahl1;
cout<<" = "<<Zahl2<<endl;
cout<<""<<endl;
cout<<"Weiterrechnen?(ja/nein)"<<endl;
cin>>Option;
}
while(Option=="ja");
}
//Euro in Dollar Rechner Versuch, ich gehe davon aus 1Euro = 1,336$ nach devisen-trader.de
float Rechner() {
const float A=1.336;
float Wert;
string option("ja");
do {
cout<<"Euro-Wert hier eingeben"<<endl;
cin>>Wert;
Wert=Wert*A;
cout<<""<<endl;
cout<<" = "<<Wert<<" US-Dollar"<<endl;
cout<<""<<endl;
cout<<"Weiterrechnen? (ja/nein)"<<endl;
cin>>option;
}
while(option=="ja");
}
int main(int argc, char *argv[]){
Anfang:
int Auswahl;
cout<<""<<endl;
cout<<"Um nach der Rechnung weiterzurechnen, geben Sie \"ja\" ein,\num das Ergebnis zu erhalten, tippen Sie \"nein\".\n"<<endl;
cout<<"Druecken sie\n1 fuer Addition,\n2 fuer Subtraktion,\n3 fuer Multiplikation,\n4 fuer Division,\n5 fuer Euro-Dollar Umrechner,\n6 zum Beenden."<<endl;
cin>>Auswahl;
switch(Auswahl) {
case 1:
Addition();
break;
case 2:
Subtraktion();
break;
case 3:
Multiplikation();
break;
case 4:
Division();
break;
case 5:
Rechner();
break;
case 6:
goto Ende;
}
goto Anfang;
Ende:
cout<<"Hier bitte Copyright-Ansprueche rein, ausserdem koennte man vllt. dieses \"Press any key\" umschreiben, danke fuers Lesen"<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}