Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello chegg expert please I need the correct and complete answers of those questions they are very important for me and in the same time

Hello chegg expert please I need the correct and complete answers of those questions they are very important for me and in the same time it's urgent very very urgent please please help me I need your help This is the Java I need them with the screen of the output Question 1 :

image text in transcribed

Question 2:

image text in transcribed

image text in transcribed

Question 3:

image text in transcribed

1. (The Mylnteger class) Design a class named Mylnteger. The class contains: 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 Aetter 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 value is even, odd, or prime, respectively. The static methods isEven(Mylnteqer), isodd(Myinteger), and isprime(Mylnteger) that return true if the specified value is even, odd, or prime, respectively. The methods equals(int) and equals(Mylnteger) that return true if the value in this 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 barselnt(strina) that converts a strina into an int 2. (The Queue class) Section 10.6 gives a class for Stack. Design a class named Queue for storing integers. Like a stack, a queue holds elements. In a stack, the elements are retrieved in a last-in first-out fashion. In a queue, the elements are retrieved in a first-in first-out fashion. The class contains: An int[] data field named elements that stores the int values in the queue. A data field named size that stores the number of elements in the queue. A constructor that creates a Queue object with default capacity 8. - The method enqueue(int v) that adds v into the queue. - The method dequeue() that removes and returns the element 2. The Queue class) In a queue, the elements are retrieved in a first-in first-out fashion. Implement the class with the initial array size set to 8. The array size will be doubled once the number of the elements exceeds the size. After an element is removed from the beginning of the array, you need to shift all elements in the array one position the left. Write a test program that adds 20 numbers from 1 to 20 into the queue and removes these numbers and displays them. 3. (New string split method) The split method in the string class returns an array of strings consisting of the substrings split by the delimiters. However, the delimiters are not returned. implement the following new method that returns an array of strings consisting of the substrings split by the matching delimiters, including the matching delimiters. public static String[] split(String s, String regex) For example, split("ab\#12\#453", "\#") returns ab,#,12,#,453 in an array of String, and split("a?b?gf\#e", "[?\#]") returns a,b, ?, b,gf, \#, and e in an array of 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

Step: 3

blur-text-image

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

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions

Question

=+appointed government officials or someone else?

Answered: 1 week ago