Exercise 4: Refinement (20%)




Document: Software Engineering 1: Lab Exercises

next Exercise 5: Finale (20%)
up Session 7: Week 14/15: Functional Decomposition
gif Exercise 3: Function Definition (20%)

Exercise 4: Refinement (20%)

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

trig4.c should behave exactly as both trig3.c and trig2.c. However, instead of calling deg_to_rad() and then calling sin(), main() should simply call a single new function, called deg_sin(). 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 sine of this angle. Again, you have to provide the definition of this new function. It should use the function deg_to_rad() which you have already written.



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