//Header
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#include <string>
using namespace std;
//Funktionsdeklaration
void MaleStrich()
{
cout<<"----------------";
}
//Body
void main ()
{
double F;
double C;
int Auswahl;
int user_eingabe_1;
int zahl;
int antwort;
antwort=1;
while (antwort !=0)
{
cout<<endl;
cout<<"Hallo"<<endl;
cout<<endl;
cout<<"Sie befinden sich im Menue"<<endl;
cout<<endl;
cout<<"Umrechnung Fahrenheit in Celsius: 1" <<endl;
cout<<endl;
cout<<"Umrechnung Celsius in Fahrenheit: 2" <<endl;
cout<<endl;
cout<<"Einen Countdown starten: 3" <<endl;
cout<<endl;
cout<<"Um zu erfahren ob es kalt,warm oder heiss wird(Celsius): 4"<<endl;
cout<<endl;
cout<<"Um zu erfahren ob es kalt,warm oder heiss wird(Fahrenheit): 5"<<endl;
cout<<endl;
cout<<"Bitte waehlen Sie aus:";
cout<<endl;
MaleStrich();
cout<<endl;
cin>>Auswahl;
cout<<endl;
cout<<endl;
switch (Auswahl)
{
case 1:
cout<<"Geben Sie Fahrenheit ein:"<<endl;
cout<<endl;
cin>>F;
cout<<endl;
C=(F-32)/1,8;
cout<<"Celsius:"<<endl;
cout<<endl;
cout<<C;
cout<<endl;
break;
case 2:
cout<<"Geben sie Celsius ein:"<<endl;
cout<<endl;
cin>>C;
cout<<endl;
F=(9/5)*C+32;
cout<<"Fahrenheit:"<<endl;
cout<<endl;
cout<<F;
cout<<endl;
break;
case 3:
cout<<endl;
cout<<"Sie starten einen Countdown."<<endl;
cout<<endl;
cout<<"Von wie vielen Sekunden soll heruntergezaehlt werden?"<<endl;
cout<<endl;
cin>>user_eingabe_1;
cout<<endl;
while (user_eingabe_1>=2)
{
if(user_eingabe_1 > 10)
{
Sleep(5000);
user_eingabe_1 -=5;
cout<<user_eingabe_1<<endl;
continue;
} else if(user_eingabe_1<=10)
{
Sleep(1000);
user_eingabe_1--;
cout<<user_eingabe_1<<endl;
continue;
}
}
cout<<"\a\a\aCountdown ende."<<endl;
break;
case 4:
cout<<endl;
cout<<"Geben Sie die Temperatur in Celsius ein, um zu erfahren ob es kalt,warm oder heiss wird."<<endl;
cout<<endl;
cin>>antwort;
cout<<endl;
if(zahl<20)
cout<<"Kalt!"<<endl;
else
{
if(zahl>30)
cout<<"Heiss!"<<endl;
else
cout<<"Warm"<<endl;
}
break;
case 5:
cout<<endl;
cout<<"Geben Sie die Temperatur in Fahrenheit ein, um zu erfahren ob es kalt,warm oder heiss wird."<<endl;
cout<<endl;
cin>>antwort;
cout<<endl;
if(zahl<68)
cout<<"Kalt!"<<endl;
else
{
if(zahl<86)
cout<<"Heiss!"<<endl;
else
cout<<"Warm"<<endl;
}
break;
while (user_eingabe_1>=2)
{
if(user_eingabe_1 > 10)
{
Sleep(5000);
user_eingabe_1 -=5;
cout<<user_eingabe_1<<endl;
continue;
} else if(user_eingabe_1<=10)
{
Sleep(1000);
user_eingabe_1--;
cout<<user_eingabe_1<<endl;
continue;
}
}
cout<<"\a\a\aCountdown ende."<<endl;
}//Ende switch
cout<<endl;
cout<<"1 fuer nochmal, 0 fuer Ende";
cout<<endl;
MaleStrich();
cout<<endl;
cin>>antwort;
}//Ende While
cout<<endl;
cout<<"Danke fuer die Nutzung des Programms, hoffentlich beehren Sie uns bald wieder!"<<endl;
cout<<endl;
MaleStrich();
cout<<endl;
cout<<"Das Programm ist geschrieben von Mir!"<<endl;
cout<<endl;
cout<<"Tschuess"<<endl;
cout<<endl;
system ("Pause");
} //Ende main
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#include <string>
using namespace std;
//Funktionsdeklaration
void MaleStrich()
{
cout<<"----------------";
}
//Body
void main ()
{
double F;
double C;
int Auswahl;
int user_eingabe_1;
int zahl;
int antwort;
antwort=1;
while (antwort !=0)
{
cout<<endl;
cout<<"Hallo"<<endl;
cout<<endl;
cout<<"Sie befinden sich im Menue"<<endl;
cout<<endl;
cout<<"Umrechnung Fahrenheit in Celsius: 1" <<endl;
cout<<endl;
cout<<"Umrechnung Celsius in Fahrenheit: 2" <<endl;
cout<<endl;
cout<<"Einen Countdown starten: 3" <<endl;
cout<<endl;
cout<<"Um zu erfahren ob es kalt,warm oder heiss wird(Celsius): 4"<<endl;
cout<<endl;
cout<<"Um zu erfahren ob es kalt,warm oder heiss wird(Fahrenheit): 5"<<endl;
cout<<endl;
cout<<"Bitte waehlen Sie aus:";
cout<<endl;
MaleStrich();
cout<<endl;
cin>>Auswahl;
cout<<endl;
cout<<endl;
switch (Auswahl)
{
case 1:
cout<<"Geben Sie Fahrenheit ein:"<<endl;
cout<<endl;
cin>>F;
cout<<endl;
C=(F-32)/1,8;
cout<<"Celsius:"<<endl;
cout<<endl;
cout<<C;
cout<<endl;
break;
case 2:
cout<<"Geben sie Celsius ein:"<<endl;
cout<<endl;
cin>>C;
cout<<endl;
F=(9/5)*C+32;
cout<<"Fahrenheit:"<<endl;
cout<<endl;
cout<<F;
cout<<endl;
break;
case 3:
cout<<endl;
cout<<"Sie starten einen Countdown."<<endl;
cout<<endl;
cout<<"Von wie vielen Sekunden soll heruntergezaehlt werden?"<<endl;
cout<<endl;
cin>>user_eingabe_1;
cout<<endl;
while (user_eingabe_1>=2)
{
if(user_eingabe_1 > 10)
{
Sleep(5000);
user_eingabe_1 -=5;
cout<<user_eingabe_1<<endl;
continue;
} else if(user_eingabe_1<=10)
{
Sleep(1000);
user_eingabe_1--;
cout<<user_eingabe_1<<endl;
continue;
}
}
cout<<"\a\a\aCountdown ende."<<endl;
break;
case 4:
cout<<endl;
cout<<"Geben Sie die Temperatur in Celsius ein, um zu erfahren ob es kalt,warm oder heiss wird."<<endl;
cout<<endl;
cin>>antwort;
cout<<endl;
if(zahl<20)
cout<<"Kalt!"<<endl;
else
{
if(zahl>30)
cout<<"Heiss!"<<endl;
else
cout<<"Warm"<<endl;
}
break;
case 5:
cout<<endl;
cout<<"Geben Sie die Temperatur in Fahrenheit ein, um zu erfahren ob es kalt,warm oder heiss wird."<<endl;
cout<<endl;
cin>>antwort;
cout<<endl;
if(zahl<68)
cout<<"Kalt!"<<endl;
else
{
if(zahl<86)
cout<<"Heiss!"<<endl;
else
cout<<"Warm"<<endl;
}
break;
while (user_eingabe_1>=2)
{
if(user_eingabe_1 > 10)
{
Sleep(5000);
user_eingabe_1 -=5;
cout<<user_eingabe_1<<endl;
continue;
} else if(user_eingabe_1<=10)
{
Sleep(1000);
user_eingabe_1--;
cout<<user_eingabe_1<<endl;
continue;
}
}
cout<<"\a\a\aCountdown ende."<<endl;
}//Ende switch
cout<<endl;
cout<<"1 fuer nochmal, 0 fuer Ende";
cout<<endl;
MaleStrich();
cout<<endl;
cin>>antwort;
}//Ende While
cout<<endl;
cout<<"Danke fuer die Nutzung des Programms, hoffentlich beehren Sie uns bald wieder!"<<endl;
cout<<endl;
MaleStrich();
cout<<endl;
cout<<"Das Programm ist geschrieben von Mir!"<<endl;
cout<<endl;
cout<<"Tschuess"<<endl;
cout<<endl;
system ("Pause");
} //Ende main