inital commit, adding all school projects
This commit is contained in:
34
funktionen2/main.cpp
Normal file
34
funktionen2/main.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <iostream>
|
||||
#include <windows.h>
|
||||
#include <iomanip>
|
||||
|
||||
using namespace std;
|
||||
|
||||
const double mwst = 0.19;
|
||||
|
||||
void ausgabe(double preis) {
|
||||
cout << "Artikel: " << endl;
|
||||
cout << "Netto: " << preis << " Euro" << endl;
|
||||
cout << "MwSt: " << preis * mwst << " Euro" << endl;
|
||||
cout << "Brutto: " << preis * (1 + mwst) << " Euro";
|
||||
}
|
||||
|
||||
int main() {
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
cout << fixed << setprecision(2);
|
||||
double preis;
|
||||
string repeat;
|
||||
do
|
||||
{
|
||||
cout << "Preis:" << endl;
|
||||
cin >> preis;
|
||||
|
||||
ausgabe(preis);
|
||||
|
||||
cout << endl << endl << "nochmal? (j/n)" << endl;
|
||||
cin >> repeat;
|
||||
}while (repeat == "j" || repeat == "J");
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user