Here is the prompt. Could you type it in C code? Thank you!: From the command window, the user should be able to run the program in * several tier one modes: * /h - Help mode (implicit and explicit) * /circle - Problem{01} : Filled circular * /annulus - Problem{02}: Annulus * /rectangle_filled - Problem{03}: filled rectangular * /rectangle_hollow - Problem{04}: hollow rectangle * For each of the main modes provided above, they must support interactive and * parametric mode. * /i - Interactive mode (using scanf) * /p - Parameter mode (parsed from argv[n]) * If incorrect or insufficient arguments are provided * - an informative error message using printf must be displayed (format: "Error: ...") * - help must be displayed. * * Functions * int circle_3D_v4_modified(double radius_max, double radius_min, * double length, int n, * double edge_face[], double area_face[], double area_outer[], double area_inner[], double volume[]); * int annulus_3D_v4_modified(double radius_outer_max, double radius_outer_min, * double radius_inner_max, double radius_inner_min, * double length, int n, * double edge_face[], double area_face[], double area_outer[], double area_inner[], double volume[]); * int rectangle_filled_3D_v4_modified(double base_max, double base_min, * double height_max, double height_min, * double length, int n, * double edge_face[], double area_face[], double area_outer[], double area_inner[], double volume[]); * int rectangle_hollow_3D_v4_modified(double base_outer_max, double base_outer_min, * double height_outer_max, double height_outer_min, * double base_inner_max, double base_inner_min, * double height_inner_max, double height_inner_min, * double length, int n, * double edge_face[], double area_face[], double area_outer[], double area_inner[], double volume[]); * void help( void ); * * Output sample: * P5_Sample.txt. * Input sample: * P5_Sample.txt. * * In addition to printing the results to the console, the results MUST also be * printed to a file using fprintf (not via batch piping). Filenames must be * hard coded as following: * * circle_3D_v4 produces: * circle_3D_v4.csv (n rows, 7 columns: radius,length,edge_face,area_face,area_outer,area_inner,volume) * annulus_3D_v4 produces: * annulus_3D_v4.csv (n rows, 8 columns: radius_outer,radius_inner,length,edge_face,area_face,area_outer,area_inner,volume) * rectangle_filled_3D_v4 produces: * rectangle_filled_3D_v4.csv (n rows, 9 columns: base,height,length,edge_face,area_face,area_outer,area_inner,volume) * rectangle_hollow_3D_v4 produces: * rectangle_hollow_3D_v4.csv (n rows, 10 columns: base_outer,base_inner,height_outer,height_inner,length,edge_face,area_face,area_outer,area_inner,volume) *
Here is the prompt. Could you type it in C code? Thank you!:
From the command window, the user should be able to run the program in
* several tier one modes:
* /h - Help mode (implicit and explicit)
* /circle - Problem{01} : Filled circular
* /annulus - Problem{02}: Annulus
* /rectangle_filled - Problem{03}: filled rectangular
* /rectangle_hollow - Problem{04}: hollow rectangle
* For each of the main modes provided above, they must support interactive and
* parametric mode.
* /i - Interactive mode (using scanf)
* /p - Parameter mode (parsed from argv[n])
* If incorrect or insufficient arguments are provided
* - an informative error message using printf must be displayed (format: "Error: ...")
* - help must be displayed.
*
* Functions
* int circle_3D_v4_modified(double radius_max, double radius_min,
* double length, int n,
* double edge_face[], double area_face[], double area_outer[], double area_inner[], double volume[]);
* int annulus_3D_v4_modified(double radius_outer_max, double radius_outer_min,
* double radius_inner_max, double radius_inner_min,
* double length, int n,
* double edge_face[], double area_face[], double area_outer[], double area_inner[], double volume[]);
* int rectangle_filled_3D_v4_modified(double base_max, double base_min,
* double height_max, double height_min,
* double length, int n,
* double edge_face[], double area_face[], double area_outer[], double area_inner[], double volume[]);
* int rectangle_hollow_3D_v4_modified(double base_outer_max, double base_outer_min,
* double height_outer_max, double height_outer_min,
* double base_inner_max, double base_inner_min,
* double height_inner_max, double height_inner_min,
* double length, int n,
* double edge_face[], double area_face[], double area_outer[], double area_inner[], double volume[]);
* void help( void );
*
* Output sample:
* P5_Sample.txt.
* Input sample:
* P5_Sample.txt.
*
* In addition to printing the results to the console, the results MUST also be
* printed to a file using fprintf (not via batch piping). Filenames must be
* hard coded as following:
*
* circle_3D_v4 produces:
* circle_3D_v4.csv (n rows, 7 columns: radius,length,edge_face,area_face,area_outer,area_inner,volume)
* annulus_3D_v4 produces:
* annulus_3D_v4.csv (n rows, 8 columns: radius_outer,radius_inner,length,edge_face,area_face,area_outer,area_inner,volume)
* rectangle_filled_3D_v4 produces:
* rectangle_filled_3D_v4.csv (n rows, 9 columns: base,height,length,edge_face,area_face,area_outer,area_inner,volume)
* rectangle_hollow_3D_v4 produces:
* rectangle_hollow_3D_v4.csv (n rows, 10 columns: base_outer,base_inner,height_outer,height_inner,length,edge_face,area_face,area_outer,area_inner,volume)
*
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images