Exercise 2: Angle Conversion (20%)




Document: Software Engineering 1: Lab Exercises

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

Exercise 2: Angle Conversion (20%)

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

trig2.c should prompt for an angle in degrees. It should then calculate the corresponding angle in radians, using the equation:

where and denote the angle expressed in degrees and radians respectively.

Having converted the angle to radians, it should then calculate, and print out, the sine (this behaviour is unchanged from trig1.c).

The degrees conversion calculation should be carried out "directly" by suitable statement(s) within the main() function. That is, this program again does not involve defining any additional new functions of your own.




Document: Software Engineering 1: Lab Exercises

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



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