Question: Design a class named Mylnteger. The test class is given below. General submission guidelines: Make sure your codes are properly documented. You will get partial

Design a class named Mylnteger. The test class is given below.  Design a class named Mylnteger. The test class is given below.
General submission guidelines: Make sure your codes are properly documented. You will

General submission guidelines: Make sure your codes are properly documented. You will get partial credit with a sufficient-commented code even if your program cannot yield the correct result. Remember to upload ONLY a zip file containing your project folder and the output. I. Create MyInteger Class (50pts) Design a class named Mylnteger. The test class is given below. public class Test1 1 public static void main (String[] args) 1 MyInteger n1 = new MyInteger (5) : System. out.println("n1 is even? " + n1.isEven()); System. out.println("n1 is prime?" + nl.isprime()); System.out. println("n1 is even? " + MyInteger.isEven (n1)); System.out.println("15 is prime? " + MyInteger.isprime (15)); char [] chars =(3,5,3,9); System. out.println (MyInteger.parseint(chars)); String s="3539"; System, out.println (MyInteger, parseInt(s)); MyInteger n2 = new MyInteger (24); System. out. print ln (" n2 is odd?" +n2. isodd()): System.out.println("n2 is prime? " + MyInteger.isprime (n2)); system.out.println ("45 is odd? " + MyInteger. isodd(45)); System. out.println ("n1 is equal to n2?"+n1. equals (n2)); System. out.println("n1 is equal to 5 ? " + n1. equals(5)); 1 Your program must contain the following methods: - An int data field named value that stores the int value represented by this object. - A constructor that creates a Mylnteger object for the specified int value. - A get method that returns the int value. - Methods isEven(), isOdd(), and isPrime() that return true if the value is even, odd, or prime, respectively. - Static methods isEven(int), isOdd(int), and isPrime(int) that return true if the specified value is even, odd, or prime, respectively. - Static methods isEven(Mylnteger), isOdd(Mylnteger), and isPrime(MyInteger) that return true if the specified value is even, odd, or prime, respectively. - Methods equals(int) and equals(Mylnteger) that return true if the value in the object is equal to the specified value. - A static method parselnt(char[]) that converts an array of numeric characters to an int value. - A static method parselnt(String) that converts a string into an int value. Please implement your own method instead of directly using the built-in Integer Class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!