From 41b85a5124b8a7cc592e0e360b26f0a432a2383f Mon Sep 17 00:00:00 2001 From: Patrice Matz Date: Sun, 22 Oct 2017 15:23:07 +0200 Subject: [PATCH] fixed unit conversion errors --- SCE/SCE/3d.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SCE/SCE/3d.h b/SCE/SCE/3d.h index 1bdc4fd..9f12255 100644 --- a/SCE/SCE/3d.h +++ b/SCE/SCE/3d.h @@ -61,7 +61,7 @@ public: cout << "Definieren Sie die Teilabschnitte des Zylinders" << endl; - cout << " Laenge: "; cin >> teil_lange; heights.push_back(teil_lange); + cout << " Laenge in mm: "; cin >> teil_lange; heights.push_back(teil_lange); cout << " Durchmesser in mm: "; cin >> teil_durchmesser; radii.push_back(teil_durchmesser); cout << " Dichte in g/mm^3: "; cin >> teil_dichte; densities.push_back(teil_dichte); cout << " Spezifischer Widerstand in ohm * (mm^2) / m: "; cin >> teil_widerstand; resistances.push_back(teil_widerstand); @@ -110,7 +110,7 @@ public: Circle circle; for (int i = 0; heights.size() != i; i++) { - mass = mass + heights[i] * circle.compute_area(radii[i]) * densities[i]; + mass = mass + heights[i]/10 * circle.compute_area(radii[i]/10) * densities[i]; } set_mass(mass); return mass; @@ -121,7 +121,7 @@ public: Circle circle; for (int i = 0; heights.size() != i; i++) { - resistance = resistance + heights[i] * 1000 * circle.compute_area(radii[i]) * resistances[i]; + resistance = resistance + ((heights[i]/1000) * resistances[i]) / circle.compute_area(radii[i]); } set_electric_resistance(resistance); return resistance;