Question: DESCRIPTION You are required to write a C program that will calculate the following: Perimeter: Square, Rectangle, Triangle, Circle. Area: Square, Rectangle, Triangle, Circle. Volume:

DESCRIPTION

You are required to write a C program that will calculate the following:

Perimeter: Square, Rectangle, Triangle, Circle.

Area: Square, Rectangle, Triangle, Circle.

Volume: Cube, Rectangular Prism, Triangular Pyramid, Sphere.

DETAILS

Your program must allow the user to choose whether they want to calculate the Perimeter, Area or Volume. Provide a menu.

Once theyve chosen their calculation from the Perimeter, Area or Volume menu your program must provide a sub-menu with the available geometric shapes in the corresponding option.

Your program must ask the user for the appropriate measurements needed to perform the calculations. Dont forget to validate the users input.

Make sure that user knows the units in which the calculations are performed and display the units in the final result. You are free to use your own measuring units.

Your program should print the result of the calculations to 2 decimal places. Make sure that your formulae use the correct data type to give the correct result.

The user must be able to make as many calculations as he wishes.

Your program must include a user define library and must have the following 4 user defined functions:

float validateInput(float userInput); //returns the userInput corrected if invalid , otherwise makes

//no corrections

float perimeterSquare(float length); //returns the perimeter of a square with a given length

float areaSquare(float length); //returns the area of a square with a given length

float volumeCube(float length); //returns the volume of a square or cube with a given length

You will add at least 3 more user defined functions.

Make your source code readable by including proper formatting (i.e. indentation), meaningful comments, meaningful variable identifiers, constants, etc.

Your program must be user friendly, this includes proper use of prompts and display of results.

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!