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

Sc 171 Midterm Find the Errors! of the following (Parts (a)-(e)), find and circl

ID: 3741523 • Letter: S

Question

Sc 171 Midterm Find the Errors! of the following (Parts (a)-(e)), find and circle all the errors so that the class and all it's methods runs properly. Briefly explain how to fix the errors. (a) (5 points) public class MyError private int 4: Fou public myerror aMybffos int 5 ut public Void multiply( String input) return input.int; (b) (5 points) Here the absence of a constructor is not an error. class such-a-mess public number Properties (int x) if (x= 0) System. out. printin( The number x is zero. )i System.out.println( The number x is less than 10. ): if (x

Explanation / Answer

Question 20a)
Answer:

public class MyError {
private int n;
public MyError() {
n = 5;
}
public String multiply(String input) {
return input+n);
}
}

Question 20b)
Answer:
class such_a_person {
public void numberProperties(int x) {
if(x==0)
System.out.println("The number x is zero");
if(x<10)
System.out.println("The number x is less than 10");
}
}

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