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

Bug fixes is 283 284 285 286 287 288 for (int i=0; i < m_Events.length; i++) { r

ID: 3721010 • Letter: B

Question

Bug fixes is

283

284

285

286

287

288

for (int i=0; i < m_Events.length; i++) {

      result += m_Events[i];

      if (i+1 < m_Events.length) {

            result += ",";

      }

    }

3024

3025

3026

3027

if (m_Selection.getSelected().contains(iNode)) {

m_BayesNet.setPosition(iNode, (int) ((m_nPosX / m_fScale - m_nPaddedNodeWidth / 2)),

(int) ((m_nPosY / m_fScale - m_nNodeHeight / 2)), m_Selection.getSelected());

}

1075

1076

1077

1078

1079

1080

Random random = new Random(1);

for (int i = 0; i < train.numInstances() / 2; i++) {

int inst = Math.abs(random.nextInt()) % train.numInstances();

int weight = Math.abs(random.nextInt()) % 10 + 1;

train.instance(inst).setWeight(weight);

}

1180

1181

1182

public int compareTo(AssociationRule other) {

      return -Double.compare(getMetricValue(), other.getMetricValue());

    }

283

284

285

286

287

288

for (int i=0; i < m_Events.length; i++) {

      result += m_Events[i];

      if (i+1 < m_Events.length) {

            result += ",";

      }

    }

3024

3025

3026

3027

if (m_Selection.getSelected().contains(iNode)) {

m_BayesNet.setPosition(iNode, (int) ((m_nPosX / m_fScale - m_nPaddedNodeWidth / 2)),

(int) ((m_nPosY / m_fScale - m_nNodeHeight / 2)), m_Selection.getSelected());

}

Explanation / Answer

[1] Line Number 286 :
Error : result += ",";
Reason : incompatible types: String cannot be converted to int
resoluation : result += Integer.parseInt(",");

[3] Line Nmuber : 1077
Error : Math.abs(random.nextInt()) % train.numInstances();
Reason : error: bad operand types for binary operator '%'
resoluation : Math.abs(random.nextInt()) % (Integer)train.numInstances();

[4] Line Nmuber 1181:
Error : return -Double.compare(getMetricValue(), other.getMetricValue());
Reason : Method should return Integer Type not double
resoluation : return Integer.compare(getMetricValue(), other.getMetricValue());

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