/////////////////////////////////////////////////////////// // Softwarebauelemente I, Aufgabe M1.1 // // author: Stephan Brumme // last changes: October 14, 2000 // include I/O-streams and math library (we use sin()) #include #include // define pi (11 digits should be enough) const double pi = 3.1415926535; // calculate the area of a n-angled surface void AreaNEdges() { // amount of edges unsigned int nEdges; // radius double dRadius; // surface area double dArea; // read edges cout<<"Ecken: "; cin>>nEdges; // read radius cout<<"Umkreisradius: "; cin>>dRadius; // calculate surface area using the given formula dArea = (double)nEdges*0.5 * dRadius*dRadius * sin(2*pi/(double)nEdges); // print result cout<<"Ein "<>dHeight; // get both radius' cout<<"Radius 1: "; cin>>dRadius1; cout<<"Radius 2: "; cin>>dRadius2; // calculate volume using the given formula dVolume = (pi*dHeight/3.0) * (dRadius1*dRadius1 + dRadius1*dRadius2 + dRadius2*dRadius2); // print result cout<<"Ein gerader Kreiskegelstumpf der Hoehe "<>nAmount; // allocate memory on heap to store the data set arData = new double[nAmount]; // read data set for (unsigned int nLoop=0; nLoop>arData[nLoop]; } // sum up the data dAverage = 0; for (nLoop=0; nLoop