Exercise 3: Function Definition (20%)




Document: Software Engineering 1: Lab Exercises

next Exercise 4: Refinement (20%)
up Session 7: Week 14/15: Functional Decomposition
gif Exercise 2: Angle Conversion (20%)

Exercise 3: Function Definition (20%)

Modify trig2.c as follows, renaming it as trig3.c.

trig3.c should behave exactly as trig2.c. However, instead of carrying out the angle conversion directly within the main() function, main() should invoke or call a new function, called deg_to_rad(), to do this conversion. This should accept a single argument, of floating_point_type, representing an angle in degrees. It should return a result, also of floating_point_type, being the corresponding angle in radians. Of course, you have to provide the definition of this new function.



McMullin@eeng.dcu.ie
Tue Apr 30 14:15:37 GMT 1996