Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10.3) (The MyInteger class) Design a class named MyInteger. The class contains: An int data field named yalue that stores the int yalue represented by

image text in transcribed

10.3) (The MyInteger class) Design a class named MyInteger. The class contains: An int data field named yalue that stores the int yalue represented by this object. A constructor that creates a MyInteger object for the specified int value. A getter method that returns the int value *The methods isEven, isOdd, and isPrime) that return true if the value in this object is even, odd, or prime, respectively The static methods isEven (int), isOdd int), and isPrime(int) that return true if the specified yalue is even, odd, or prime, respectively The static methods isEven(MyInteger), isOdd(MyInteger), and isPrime(MyInteger) that return true if the specified value is even, odd,or prime, respectively * The methods equals (int) and equals(MyInteger) that return true if the yalue in this 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 and then implement the class. Write a client program that tests all methods in the class. Given that the definition of a prime number is a positive integer be sure to instruct the use to only enter positive integers SAMPLE RUN #1 -. Prompts For Keyboard/Console/Standard Input Enter a positive integer to create a MyInteger object or to move on to next part of program Enter a positive integer to test static isXXX(int) methods or to move on to next part of program Enter a positive integer to test static isXXX(MyInteger) methods or to move on to next part of program: Enter a the first of two positive integers to create obj2 and test obj2.equals(int) or to move on to next part of program Enter a the second of two positive integers to test obj2.equals(int): Enter a the first of two positive integers to create obj2 and test obj2.equals(MyInteger obj3) or to move on to next part of program: Enter a the second of two positive integers to create obj3 and test obj2.equals(MyInteger obj3) Enter a positive integer that will be placed into a char array to demonstrate the MyInteger.parseInt (char]): Enter a positive integer that will be placed into a String to demonstrate the MyInteger parseInt(String): 10.3) (The MyInteger class) Design a class named MyInteger. The class contains: An int data field named yalue that stores the int yalue represented by this object. A constructor that creates a MyInteger object for the specified int value. A getter method that returns the int value *The methods isEven, isOdd, and isPrime) that return true if the value in this object is even, odd, or prime, respectively The static methods isEven (int), isOdd int), and isPrime(int) that return true if the specified yalue is even, odd, or prime, respectively The static methods isEven(MyInteger), isOdd(MyInteger), and isPrime(MyInteger) that return true if the specified value is even, odd,or prime, respectively * The methods equals (int) and equals(MyInteger) that return true if the yalue in this 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 and then implement the class. Write a client program that tests all methods in the class. Given that the definition of a prime number is a positive integer be sure to instruct the use to only enter positive integers SAMPLE RUN #1 -. Prompts For Keyboard/Console/Standard Input Enter a positive integer to create a MyInteger object or to move on to next part of program Enter a positive integer to test static isXXX(int) methods or to move on to next part of program Enter a positive integer to test static isXXX(MyInteger) methods or to move on to next part of program: Enter a the first of two positive integers to create obj2 and test obj2.equals(int) or to move on to next part of program Enter a the second of two positive integers to test obj2.equals(int): Enter a the first of two positive integers to create obj2 and test obj2.equals(MyInteger obj3) or to move on to next part of program: Enter a the second of two positive integers to create obj3 and test obj2.equals(MyInteger obj3) Enter a positive integer that will be placed into a char array to demonstrate the MyInteger.parseInt (char]): Enter a positive integer that will be placed into a String to demonstrate the MyInteger parseInt(String)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions

Question

Evaluate three pros and three cons of e-prescribing

Answered: 1 week ago

Question

Comment should this MNE have a global LGBT policy? Why/ why not?

Answered: 1 week ago