This lab requires that you implement a single program to compute the area and the perimeter of a rectangle. You should download and unpack lab2.zip to get started (this contains checkit.h and Makefile).
Develop the following program in a file named lab2.c. When you are ready to compile the program, type make debug to get a debug version of the program.
For this lab, you must develop three test cases for each of the functions described below. It is recommended that you develop these test cases before you write the code for each function. Place the test cases in the test_cases function.
Develop a function to compute the area of a rectangle from its width and height. You must pick an appropriate name for the function and appropriate data types for the parameters and for the return type.
Develop a function to compute the perimeter of a rectangle from its width and height. You must pick an appropriate name for the function and appropriate data types for the parameters and for the return type.
In the main function, invoke the test_cases function. Once all of your test cases have successfully passed, implement the following user interaction requirement.
In a new function (invoked from main), prompt the user of your program, using printf, for the height and width of a rectangle. Using scanf, read the user input. Invoke the functions that you defined above (after you've tested them) to compute the area and perimeter of the rectangle and print the results for the user to see.
Demonstrate your work to your instructor to have this lab recorded as completed.
You will need to show the test cases that you developed (demonstrate that they all pass) and demonstrate the interactive execution of your program.
If you have time, add functionality to compute the circumference and the area of a circle and add test cases to the test_cases function. Finally, prompt the user for the radius of a circle and print its area and circumference.