[其他] java 救救我

本帖最後由 lamkinkin 於 2015-4-21 00:07 編輯

public class Line extends Point  {

  protected  double  m;   // declare a new data member m

  // Null constructor
  public Line () {


  }

  // Constructor using point-slope form
  public Line (int xValue, int yValue, double mValue) {

    super(xValue, yValue);
    m = mValue;

  }

  // Constructor using slope-intercept form
  public Line (double mValue, int cValue) {

    ???????
  }

  public void setM (double mValue) {

    ?????

  }

  public double getM () {

    ???????

  }

  public double getY_intercept () {

    ?????

  }

  public double getX_intercept () {

    ???

  }

  public void setX_intercept (double Xintercept) {

    ?????

  }

  public void setY_intercept (double Xintercept) {

    ?????

  }

  // utility method
  public void showLine () {

    System.out.println("[ y = " + super.getY + " x = "
                        + super.getX + " m = " + getM + "\t"
                        + "Equation: " + ????????);

  }

}



應該怎樣做   求救~




public class Line extends Point  {

   protected  double  m;   // declare a new data member m

   // Null constructor
   public Line () {


   }

   // Constructor using point-slope form
   public Line (int xValue, int yValue, double mValue) {

     super(xValue, yValue);
     m = mValue;

   }

   // Constructor using slope-intercept form
   public Line (double mValue, int cValue) {

    this.m = m;
    this.c = c;
   }

   public void setM (double mValue) {

     this.m = m;

   }

   public double getM () {

     return m;

   }

   public double getY_intercept () {

     return y;

   }

   public double getX_intercept () {

     return x;

   }

   public void setX_intercept (double Xintercept) {

     this.x = x;

   }

   public void setY_intercept (double Xintercept) {

     this.y = y;


   }

   // utility method
   public void showLine () {

     System.out.println("[ y = " + super.getY + " x = "
                         + super.getX + " m = " + getM + "\t"
                         + "Equation: " + ????????);   呢個真係唔識

   }

}

返去問老師

TOP

此post已完

自己努力

TOP

你應該好好地諗下你畢業之後慘痛ge工作生活——假若你係宜家唔好好地讀書學好你要學ge野

TOP

如果你切碎條題目,每次少部分咁放上嚟,都可能有師兄答你,你直接放,切都懶無可能

TOP

返去問Maths老師……

TOP

有晒提示例子要做d 乜....
其餘果d getter/setter都係基本野

TOP

如果你切碎條題目,每次少部分咁放上嚟,都可能有師兄答你,你直接放,切都懶無可能 ...
brotherofninth 發表於 2015-4-19 22:59



    其實點都唔會有人比答案, 只會比 improvement

TOP

有晒提示例子要做d 乜....
其餘果d getter/setter都係基本野
ckmakit 發表於 2015-4-19 23:19


    其實當你對一樣野唔熟,俾咩例子都死,寧願信人都唔信自己

利申: yr1 前半個學期對java 0認知,依家已改善

TOP

其實點都唔會有人比答案, 只會比 improvement
snoopy11hk 發表於 2015-4-19 23:21

都係,師兄大多數係俾idea你,要自己再思考 前提要有一定基礎先明

TOP