//Berechnet Widerstandsmomente und Traegheitsmomente eines Rechteck-
//querschnittes (c) sdteffen 5/97

// Fuer DataInputStream
import java.io.*;

class Widerstandsmoment 
{
   	//Querschnitt
   double fBreite = 0, fHoehe = 0, fA;
   //Statische Groessen
   double fWx, fWy, fIx, fIy;
   
	public static void main(String args[]) throws IOException
	{
		new Widerstandsmoment();
	}
	
	public Widerstandsmoment() throws IOException
	{
		//Eingabe
		DataInputStream disEingabe = new DataInputStream(System.in);
		
		System.out.print("Eingabe der Breite : ");
		fBreite= Double.valueOf(disEingabe.readLine()).doubleValue();
		System.out.print("Eingabe der Hoehe  : "); 
		fHoehe= Double.valueOf(disEingabe.readLine()).doubleValue();

		// Berechnung

		fA= fHoehe * fBreite;
		fWx = fBreite * Math.pow(fHoehe,2) / 6;
		fWy = fHoehe * Math.pow(fBreite,2) / 6;         
		fIx = fBreite * Math.pow(fHoehe,3) / 12;
		fIy = fHoehe * Math.pow(fBreite,3) / 12;

		// Ausgabe

		System.out.println("Ergebnisse");
		System.out.println("-----------------------------------------");
		System.out.print("Querschnittflaeche          : ");
		System.out.println(fA);
		System.out.print("Widerstandsmoment um x-Achse: ");
		System.out.println(fWx);
		System.out.print("Widerstandsmoment um y-Achse: ");
		System.out.println(fWy);    
		System.out.print(" Traegheitsmoment um x-Achse: ");
		System.out.println(fIx);    
		System.out.print(" Traegheitsmoment um x-Achse: ");
		System.out.println(fIy);    
	}

}

