Created the solution_3.cpp
This commit is contained in:
parent
e3318da4ef
commit
92f76a93f3
35
units/2023_10_26/solution_3.cpp
Normal file
35
units/2023_10_26/solution_3.cpp
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
// Variablendeklaration
|
||||||
|
int Maeuse, Einzelpreis;
|
||||||
|
double Nettowarenwert, Transportpauschale, Umsatzsteuer, Bruttobetrag;
|
||||||
|
|
||||||
|
// Eingabe
|
||||||
|
cout << "Geben Sie die Anzahl der PC-Maeuse ein: ";
|
||||||
|
cin >> Maeuse;
|
||||||
|
|
||||||
|
cout << "Geben Sie den Einzelpreis ein: ";
|
||||||
|
cin >> Einzelpreis;
|
||||||
|
|
||||||
|
// Berechnung
|
||||||
|
Nettowarenwert = Maeuse * Einzelpreis;
|
||||||
|
Transportpauschale = Maeuse >= 10 ? 0 : 10;
|
||||||
|
Umsatzsteuer = (Nettowarenwert + Transportpauschale) * 0.19;
|
||||||
|
Bruttobetrag = Nettowarenwert + Transportpauschale + Umsatzsteuer;
|
||||||
|
|
||||||
|
|
||||||
|
// Ausgabe
|
||||||
|
cout.setf(ios::fixed);
|
||||||
|
cout.precision(2);
|
||||||
|
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
cout << "Nettowarenwert : " << Nettowarenwert << " Euro" << endl;
|
||||||
|
cout << "+ Transportpauschale : " << Transportpauschale << " Euro" << endl;
|
||||||
|
cout << "+ Umsatzsteuer : " << Umsatzsteuer << " Euro" << endl;
|
||||||
|
cout << "------------------------------------" << endl;
|
||||||
|
cout << "= Bruttobetrag : " << Bruttobetrag << " Euro" << endl;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user