Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Splitting into multiple files You are to create a program that reads the dimensi

ID: 3689769 • Letter: S

Question

Splitting into multiple files You are to create a program that reads the dimensions of geometric shapes from command line and computes and outputs the area of the shape. Your program will consist of multiple files as follows Create a header file geometry.h and add to it the following . A marcro definition for the constant P .A prototype definition for the function computeCircleArea. This function takes as input the radius of a circle and returns its area .A prototype definition for the function computeRectancleArea This function takes as input the ength and width of a rectangle and outputs its area. Create a source file geometry.c and add to it the definition of the two functions Create your main program areas.c so reads the parameters from command line. if the is crete, the command line parameter should be the letter C folowed by the radius. the shapeisareaade. the command line parameters should be the letter R followed by the length and the width. The following is an example of valid parameters a.out R 12.5 14.2 a-out C 3.6 a.out C 10.2 Your program should compute the area according to the parameters given. if the program is given inalld parameters, it should display an error message to the user and exit. The outputs corresponding to the previous examples are C 40.7 C 326.8 Note that the numeric vallues read from command line are read as strings. Use the function ator defined as: double a tof (const char ·st r) in stdlib.h to convert from string to fat as Use the following to compile and build your program: gee-areas areas.c geometry-h geometry.e Test your program on the given examples as well as some other invalid inputs Using a makefile Create a makefile to build your programc Add the following rule areas: areas.o geometry.o gce-o areas areaso geopetty- Make sure the second line of your rule starts with tab and not spaces. Build your program by esecuting the makefile Does your program build successfully? The building process needs to know about the dependencies. Add the following rule to your makefile areas.o: areas.c geonetry.h gcc-c areas.o

Explanation / Answer

This prpgram will help to call functions to computer the area of circle and rectangle depending on the user's choice.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote