Classwork 16: Function Prototypes
To practice writing the function prototype for a simple function and practice implementing a simple function.
Your assignment is to implement a simple function that determines whether a box is larger than a shoebox. The function that you implement must be compatible with the main program in this file: main16.c.
The function takes three floating point parameters which correspond to the height, length and width of a box. We will define a "standard" shoebox to be 4 inches high, 11.75 inches long and 7.25 inches wide. If a box is taller, longer or wider than the standard shoebox, then your function should return 1 to indicate true. Otherwise, the box in question is considered smaller than a shoebox and your function should return 0.Step 1:
First, download the main program in the file main16.c. Make sure you save it with a filename that ends with .c.
Using the information given above, including the source code of the main program, write the function prototype for the function isBiggerThanShoeBox() and insert it above the main function as indicated.Step 2:
Below the main program, write the C code to implement the isBiggerThanShoeBox() function. Your function must be compatible with the main() function as given. You must not alter the code in main() in any way.
Compile and run your program. Use the -Wall option with gcc. Your program should compile without any warnings or errors.
SubmittingUse the script command to record yourself compiling and running the program. Submit your C source code and the typescript file as usual:
submit cs104_chang cw16 main16.c submit cs104_chang cw16 typescript
Be sure to logout completely when you have finished!