<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<blockquote cite="mid:350332.29445.qm@web37006.mail.mud.yahoo.com"
type="cite">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td
style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;"
valign="top">Your directions for assignment one are very vague and I
cant quite understand exactly what the program is suppose to
accomplish. It states that the program allows the user to enter two
data points, but continues by implying that the y value for one of the
data points that we supposably entered will be used to calculate the x
value. I looked at the API for line.class but it was not specific
enough for me to find out what is actually being calculated by the
program and what is know. Does the forecastx, forecasty, getslope, and
getyint simply return the value? Do we simply use setslope and setyint
to contain the values shown on your sample run or is there some kind of
calculations going on in that method? If there was some way for me to
just view the line.class file as it was written as line.java file I
could better understand how to achieve your desired output, but the
.class file displays some abstract code that I do not understand.
Thank You.</td>
</tr>
</tbody>
</table>
<br>
</blockquote>
<br>
Did you look at the sample output on the web page. By calling the
class constructor with four data values ([x1,y1], [x2,y2]), you
uniquely define a line. As the API states, if you provide forecastY
with an argument that is an "x" value on the line, it will return the
"y" value. Likewise, if you give forecastX a "y" value argument, it
will return the "x" value. Similarly, once you call the constructor,
you can also return the value of the slope and Y-intercept using the
appropriate calls to the line.class. All I am doing in the line class
is playing around with the equation<br>
<br>
y = mx + b<br>
<br>
I just hid all of the math from you because the point at this stage of
the game is for you to become familiar with objects and using them.
I also included some "extra" pieces in the API that you don't even
need. There are two additional constructors and the methods setSlope
and setYInt will allow you to set the values of those entities (which
together also uniquely define a line). Please understand, a major
point of this lesson is for you NOT to have the line.java file. If
you need help using the line.class, please don't hesitate to contact me
or even send me snippets of code.<br>
<br>
Don't fret -- math -- and lots of LOGIC loom on the horizon...<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Andrew J. Pounds, Ph.D. (<a class="moz-txt-link-abbreviated" href="mailto:pounds@theochem.mercer.edu">pounds@theochem.mercer.edu</a>)
Associate Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
</pre>
</body>
</html>