Try to enjoy your work while doing it,it will Automatically convert in Hard Work...
Apart from the fact that there is no such thing as a 2D array in Java®; what you see are arrays of arrays, which are different ... why do you have to use such a strange technique?Saad Mushtaq wrote:. . . I have to use 2D arrays of chars and would prefer to do it this way insetad of using Point2D class of java or some other graphical classes of java.
You are calling a point points and the list of points point? There is nothing like clear naming and that is nothing like clear naming. . .. . .
There are three kinds of actuaries: those who can count, and those who can't.
Piet Souris wrote:(...) such that the vector y = (y1, y2, ... yn) in the series equations a * xi + b = yi (i = 1, ... n) is minimized in length.
There are three kinds of actuaries: those who can count, and those who can't.
. . .
You are calling a point points and the list of points point? There is nothing like clear naming and that is nothing like clear naming
Why are you using integer arithmetic in lines 11-12? Why have you got separate variables n and count? Why are you going on about an array and then using the size() method? Have you got a List<Point> rather than an array? You mean you are only using the array for displaying your results? What does line 22 mean, apart from confusing enough to make the whole program incomprehensible all by itself?
I think it is a bad idea to use floats; if you have to use floating‑point arithmetic, use doubles.Saad Mushtaq wrote:. . . I have changed the int to float.
I think you were right to create your own point class rather than using Point2D.Also there is a Point2D class in java.
Are you really telling us you are happy writing not elegant code. . . i want to go with this one even though this is not elegant.
Are you really telling us you are happy writing not elegant code
All things are lawful, but not all things are profitable.
Knute Snortum wrote:I think we're going to need the full code to help debug this.
A note about "elegant" code. Poor formatting is a bug. It may not cause a compile error but it can hide errors that could be more easily spotted. Also, if you want others to help debug your code, formatting really is a must. This style guide will help you with one kind of formatting.
I think we're going to need the full code to help debug this.
Knute Snortum wrote:I think we're going to need the full code to help debug this.
A note about "elegant" code. Poor formatting is a bug. It may not cause a compile error but it can hide errors that could be more easily spotted. Also, if you want others to help debug your code, formatting really is a must. This style guide will help you with one kind of formatting.
All things are lawful, but not all things are profitable.
Knute Snortum wrote:I don't know it this is correct or not, but it's closer. Use the constants ROWS and COLS and things go better.
There are three kinds of actuaries: those who can count, and those who can't.
Consider Paul's rocket mass heater. |