I thought that the lines 9-14 were setting the x and y variables to their proper value? |
Lines 9 - 14 are defining a constructor for your class. The way you've defined your constructor, it's calling 4 other functions/methods. But now that I look at it, I've noticed that I don't see the definitions for those functions. Where have you defined set_x1, set_x2, set_y1 and set_y2? Are they supposed to be methods belonging to Distance? Global functions? Methods on another class?
So lose the {} in line 25 and 27? |
Well, that would mean that those four local variables will be in scope for the entire main function. Is that what you want?
Remove the numbers from the parentheses. |
Declare the parameters that you want those methods to take in the parentheses. What are those parameters? Do you want them to take any parameters at all?
Right? I just want to get this correct and figure out how it works. I hate not understanding what went wrong and having to turn in something unfinished. |
Well, to be honest, it seems to me that a book - a good one - is going to help you more than me answering questions. I don't mean to be rude, but right now, it looks as though you're just typing random things that look a bit like C++ without knowing what they mean, in the hope that you somehow magically stumble upon a combination of numbers and letters that works. And, believe me, it's very unlikely that's going to happen.
You need to go back to some tutorial sources, and learn about classes. Learn how to define them. Learn what a method is, and how to define one. Learn what a data member is, and how to define one. Learn how to instantiate an object of a given class. Learn how to call methods, how to pass parameters into them, and how to return values from them.
Once you actually understand what you're writing, you'll be able to turn in some finished work.