I just reverted to the old header file, and decided to take a screenshot to possibly clear it up:
http://img90.imageshack.us/img90/9528/lab2imageja3.png
Hopefully this helps.
And sorry, when...
Type: Posts; User: Nadril
I just reverted to the old header file, and decided to take a screenshot to possibly clear it up:
http://img90.imageshack.us/img90/9528/lab2imageja3.png
Hopefully this helps.
And sorry, when...
It does. It is supposed to compute the value and return it.
With the way it was set up the instructor was initializing those variables locally (yIntercept and slope) so I only put them in the...
It's just supposed to get the value of the yIntercept for the points and slope you entered earlier.
For the most part I do, yes.
constructor is whats in .h if I'm not mistaken (where...
Well when I take out float yIntercept; in getIntercept() it didn't actually do anything. If I take it out of the header file than it gives me an error.
Sorry if I'm not really grasping what you're...
segment.h
class Segment
{
private:
float X1;
float Y1;
float X2;
float Y2;
float slope;
Just updated the main post. I no longer get any errors but it is giving me a bad value for y Intercept.
Actually I believe I just got it. Only problem now is a bit of a logic issue (getting the wrong number for yIntercept) but I don't think that will be difficult.
Thanks for the help.
edit:...
Very stupid question, but how would I go along making it a member variable?
The thing that is bugging me is that X1,X2,Y1,Y2 are all working fine for other parts of the program but slope or...
Hi everyone. I'm currently trying to learn programming (taking a class for it) but am stuck on why this isn't working. I'm sure its something stupid. This is the program in question:
main.cpp:
...