inital commit, adding all school projects
This commit is contained in:
55
Rabattrechner/main.cpp
Normal file
55
Rabattrechner/main.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
//var
|
||||
string cLoopContinue;
|
||||
|
||||
// print title
|
||||
string title = "RABATTRECHNER V1.0";
|
||||
cout << title << endl;
|
||||
for (int i = 0; i < title.length(); i++) {
|
||||
cout << '=';
|
||||
}
|
||||
cout << endl << endl;
|
||||
|
||||
do
|
||||
{
|
||||
// In loop vars
|
||||
float fEinzelPreis = 0;
|
||||
float fRabatt = 0;
|
||||
float fGesamtpreis = 0;
|
||||
int iBestellmenge = 0;
|
||||
|
||||
cout << "Bitte geben Sie den Einzelpreis (netto) an: ";
|
||||
cin >> fEinzelPreis;
|
||||
|
||||
cout << endl << "Bitte geben Sie die Bestellmenge an: ";
|
||||
cin >> iBestellmenge;
|
||||
|
||||
if (iBestellmenge > 1000) {
|
||||
fRabatt = 7.5;
|
||||
} else if (iBestellmenge > 501) {
|
||||
fRabatt = 5;
|
||||
} else if (iBestellmenge > 100) {
|
||||
fRabatt = 2.5;
|
||||
}
|
||||
|
||||
cout << "Rabattsatz\t\t:\t" << fRabatt << endl;
|
||||
|
||||
fGesamtpreis = (iBestellmenge * fEinzelPreis) * ((100 - fRabatt)/100);
|
||||
cout << "Gesamtpreis (netto)\t:\t" << fGesamtpreis << endl;
|
||||
|
||||
cout << "Umsatzsteuer (19%)\t:\t" << (fGesamtpreis*0.19) << endl;
|
||||
|
||||
cout << "Gesamtpreis\t\t:\t" << (fGesamtpreis*0.19 + fGesamtpreis) << endl;
|
||||
|
||||
cout << "Nochmal? (j,n) ";
|
||||
cin >> cLoopContinue;
|
||||
|
||||
|
||||
} while (cLoopContinue == "j" || cLoopContinue == "J");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user