Question: c programming, mutiple files You are to create a program that reads the dimensions of geometric shapes trom command line and computes and outputs the

c programming, mutiple files

c programming, mutiple files You are to create a program that reads

the dimensions of geometric shapes trom command line and computes and outputs

You are to create a program that reads the dimensions of geometric shapes trom 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 length 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 it reads the parameters from command line. If the shape is a circle, the command line parameter should be the letter C followed by the radius. If the shape is a rectangle, the command line parameters should be the letter R followed by the length and the width. The following is an example oTVaila parameers. >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 invalid 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!