Created the solution_8.cpp

This commit is contained in:
Mathias Wagner 2023-11-06 12:50:01 +01:00
parent d11511774d
commit e351845c17
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -0,0 +1,33 @@
#include <iostream>
using namespace std;
int main() {
// Variablen deklarieren
double Sollstunden, Iststunden, Stundenlohn, Bruttolohn, Ueberstunden;
// Eingaben einlesen
cout << "Geben Sie die Monats-Sollstunden ein: ";
cin >> Sollstunden;
cout << "Geben Sie die Monats-Iststunden ein: ";
cin >> Iststunden;
cout << "Geben Sie den Stundenlohn ein: ";
cin >> Stundenlohn;
// Berechnen
Ueberstunden = Iststunden - Sollstunden;
if (Ueberstunden < (Ueberstunden*1.1)) {
Bruttolohn = Stundenlohn * Sollstunden + (Ueberstunden * Stundenlohn * 1.25);
} else {
Bruttolohn = Stundenlohn * Sollstunden + (Ueberstunden * Stundenlohn * 1.30);
}
// Ausgabe
cout.setf(ios::fixed);
cout.precision(2);
cout << "Der Bruttolohn beträgt: " << Bruttolohn;
}