*Help Needed*

B

big dan

I need some help. Here's some code for some work I have to do:

/*DataSet.java defines a class of DataPoint objects. These objects
*maintain a collection of DataPoint objects and
*contain various methods which enable the DataSet object to
*show certain behaviours*/

class DataSet
{

//* instance variables********************************************

//DataPoint dp = new DataPoint();

private DataPoint[] data;
private static final int MAXNUMDATAPOINTS= 5;
private int numDataPoints;
private int length;
private String marker;

/*other private variables*****************************************/
private String maxMark ="<<<<Max";
private String minMark ="<<<<Min";
private String foundMark ="<<<<found";

/*constructor********************************************************/
private
void init()
{
DataPoint = new int[MAXNUMDATAPOINTS];
}
public
DataSet() // no arguments
{
numDataPoints = MAXNUMDATAPOINTS;
init();
}
/* methods needed to implement behaviours of the
object******************/

/*addDataPoint() enables a Datapoint to be added to the
collection****/
public boolean addDataPoint(DataPoint dp)
{
if (length == MAXNUMDATAPOINTS )
return false;

sp.marker[length] = new DataPoint (dp);
length ++;
return true;

/*these methods change the value of the marker attribute of DataPoint
to one of the appropriate strings e.g. "<<<<max"*/

public void markMaxY()
{

}

public void markMinY()
{

}
/*displayAll(boolean show) if true returns a string showing the full
contents of the collection if false the string only contains x and y
values*/

public String displayAll(boolean show)
{
if (show = false);
return true

if (show = true);


}

/* changeValues enables the values of a data pair specified by its
index in the collection to be changed */
//public void changeValues(int index, int xvalue, int yvalue)

/* reader methods**********************************************/
public int getMAXNUMDATAPOINTS()
{
return MAXNUMDATAPOINTS;
}

public int getnumDataPoints()
{
return numDataPoints;
}

/* writer methods**********************************************/
public void setX(int index, int xvalue)
{
setXindex = index;
setXvalue = xvalue;
}
public void setY(int index, int yvalue)
{
setYindex = index;
setYvalue = yvalue;
}

//*toString(int i) returns a string holding the x and y values of one
data pair
public String toString(int i)
{
String i = xvalue + yvalue;
return i;
}

/* findAverageY()returns the average of y values as a double */
public double findAverageY()
{


}

/* findGreaterThan(int value) returns a String containing all data
pairs where the
* y value is greater than value. Use for Menu item 7 */
//public String findGreaterThan(int value)

/*other methods You may place your own methods here
***************************/
}
}
 
M

Michael Borgwardt

big said:
I need some help.

Indeed you will probably need help to explain this to your
teacher, Mr. Townsend, to whom I've just pointed out this
posting.

Idiot.
 
B

big dan

Michael Borgwardt said:
Indeed you will probably need help to explain this to your
teacher, Mr. Townsend, to whom I've just pointed out this
posting.

Idiot.

I was only asking for some pointers, not the entire code.

I would not cheat on anything, not even on a bet.
 
M

Michael Borgwardt

big said:
I was only asking for some pointers, not the entire code.

No, you didn't. You posted a mass of code and asked for non-specific "help".

People will gladly help you here when you ask *specific* questions,
show what you're tried and how it failed. They won't do your work for you
or telepathically guess where your problems lie.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top