Java - CMIS242 - (The My Integer class) Design a class named My Integer. The class contains: An int data field named value that stores the int value represented by this object. A constructor that creates a My Integer object for the specified int value. Pr

$5.00

Details

Details

(The My Integer class) Design a class named My Integer. The class contains:

An int data field named value that stores the int value represented by this object

A constructor that creates a My Integer 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 method isEven(MyInteger), isOdd(MyInteger) and isPrime(MyInteger) that return true if the specified value is even, odd or prime respectively.

Methods equals(int) and equals(MyInteger) that return true if the value in the object is equal to the specified value

A static method parseInt(char[]) that converts an array of numeric characters to an int value

A static method parseInt(String) that converts a string into an int value.

Draw the UML diagram for the class. Implement the class. Write a client program that tests all the methods in the class.

Make sure to use your IDE to properly indent your code, remove generated comments that do not apply to the code, have a header that clearly states your name, the purpose of the work

Provide a screenshot of your IDE running your test program in debug mode, stopped on a breakpoint set in the instance method isPrime(), and attach your 2 files named MyInteger.java and TestMyInteger.java to your posting.

 

 

Additional Info

Additional Info

Programming LanguageJava

Reviews

Write Your Own Review

You're reviewing: Java - CMIS242 - (The My Integer class) Design a class named My Integer. The class contains: An int data field named value that stores the int value represented by this object. A constructor that creates a My Integer object for the specified int value. Pr

How do you rate this product? *

 1 star2 stars3 stars4 stars5 stars
Quality
Value for Money

Tags

Use spaces to separate tags. Use single quotes (') for phrases.