Hints
Document: Software Engineering 1: Course Notes
Session 5: Week 9/10: Introducing Recursion
Session 4: Week 7/8
Preparation
- In testing the WOTRATE.C
program, it is essential that you prepare a number of test cases for
which you know "with certainty" what the correct answers are - so that
you can decide whether the program is giving these correct answers or not.
"Certainty" is hard to come by, of course. But in this particular
case, you may be able to use some of the work you
have done in previous lab(s) to generate "reliable" test cases.
- In Exercise 3 you are asked to write two new functions.
Implicitly, of course, you are also expected to check whether your
functions Sine() and Cosine() work correctly or not. But
note that a function does not do anything unless and until it is called.
So to properly complete this exercise, there must be a main()
function which allows you to exercise the Sine() and
Cosine() functions.
- For Exercise 3, your essential problem is to convert from degrees
to radians - since, if you could do that, you could the use the existing library functions sin(x) and cos(x) to complete
the required calculations. So: as a first step, try to write a program
which just has a main() function which does this conversion from
degrees to radians. Then modify this program so as to encapsulate the
actual conversion proper in a function of its own. Then add the function
Sine(), and finally the function Cosine. At each stage make
sure that everything is working correctly: do not try to do too much at
any one step.
Document: Software Engineering 1: Course Notes
Session 5: Week 9/10: Introducing Recursion
Session 4: Week 7/8
Preparation
McMullin@ugmail.eeng.dcu.ie
Wed Mar 15 10:20:49 GMT 1995