#include #include #include using namespace std; typedef struct Pipe { double diameter ; // [mm] double length ; // [m] double thickness ; // [mm] char *material ; // "Cast iron" "Steel" "Cu" "PVC" "Al" } PIPE; // --------------------------------- void display_pipe(PIPE pipe0 ); void create_pipe(PIPE *pipe0); int main() // How to use STRUCTURES !!!! ------------------- { const int SIZE=1000; PIPE pipes[SIZE]; for (int i=0; ilength = (rand()%61+10)/10.+1.; // 1.-7. [m] pipe0->diameter = rand()%(5+1)*10; pipe0->thickness = pipe0->diameter*0.1; int a = rand()%5 + 1; // 1 - 5 if (a== 1) pipe0->material = "Steel"; if (a== 2) pipe0->material = "Cu"; if (a== 3) pipe0->material = "Cast Iron"; if (a== 4) pipe0->material = "PVC"; if (a== 5) pipe0->material = "Al"; } // ------------------------------------------------- void display_pipe(PIPE pipe0 ){ cout <<"Pipe parameters"<