Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have no idea what to do for this question implement a class name cPointType.ja

ID: 3812934 • Letter: I

Question

I have no idea what to do for this question

implement a class name cPointType.java. A cPointType has a label and missing x, y values (doubles). It provides the methods to set each of the coordinates (g…[] initial value), change the each(increasing or decreasing the position by some value), to a current value, to get the label value and to return the label value of the or second constructor that allows for setting the label and position on instan…([]) cPrintType has a toString method that returns the cPointType as label(x,y)

When I received this question, some of the words were cut off, so I am undressing them as []

Explanation / Answer

class cPoint{
String label;
double x,y;

public String getLabel() {
return label;
}

public void setLabel(String label) {
this.label = label;
}

public double getX() {
return x;
}

public void setX(double x) {
this.x = x;
}

public double getY() {
return y;
}

public void setY(double y) {
this.y = y;
}

public cPoint(String label, double x, double y) {
this.label = label;
this.x = x;
this.y = y;
}
  
public void changeX(int del){
this.x = this.x + del;
}
  
public void changeY(int del){
this.y = this.y + del;
}
  
@Override
public String toString(){
return label+"("+x+","+y+")";
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote