diff --git a/units/2023_11_20/solution_1.cpp b/units/2023_11_20/solution_1.cpp new file mode 100644 index 0000000..976c407 --- /dev/null +++ b/units/2023_11_20/solution_1.cpp @@ -0,0 +1,33 @@ +#include + +using namespace std; + +int main() { + // Variablendeklaration + double length, width, height, volume; + char restart; + + while (restart != 'n') { + cout << "Geben Sie die Laenge ein: "; + cin >> length; + + cout << "Geben Sie die Breite ein: "; + cin >> width; + + cout << "Geben Sie die Hoehe ein: "; + cin >> height; + + // Berechnung + volume = length * width * height; + + // Ausgabe + cout.setf(ios::fixed); + cout.precision(1); + + cout << "Volumen: " << volume << " m3" << endl; + + // Wiederholung + cout << "Wollen Sie nochmal? (j/n): "; + cin >> restart; + } +} \ No newline at end of file