Topics
Complex Roots
The first step was step was to the get program working in the case of a double root. This part was a matter of fixing a few bugs from the program and making sure we had the header file in the correct folder. There was also a problem with the include. Instead of using the < someting.h> we had to use #include "File.h". The quotes seem to be important to the header files we create and place in the folder. I imagine it directs the compiler of where to look for the header.
Next, we were supposed to set up a structure to deal with the different kind of roots (real, double, complex). I did this by using a series of else if statements that check the value of discriminent. if the roots aren't real and distinct or complex then we must have a double root.
I tested the values and they all worked out alright.
Getting two decimal points of precision meant first fixing the decimal point and then asking for 2 point of precision. You can see the levels of precision in the above code. Full disclosure, I wrote the blog after finishing the lab.
No comments:
Post a Comment