Question: Design a class MinMaxprime that has two private member variables that are prime ( Use the previous Prime class ) maxP and minP, where maxp

Design a class MinMaxprime that has two private member variables that are prime (Use the previous Prime class) maxP and minP, where maxp should always, at all times, be greater or equal to minP.
1- default constructor that sets both to default Prime
2- A constructor that accepts one Prime and sets both to that Prime
3 A constructor that accepts an integer and sets both to that integer or the prime close to it.
4- A constructor that accepts two Primes and sets maxP to the largest and minP to smallest
5- A constructor that accepts two integers and sets maxP to the largest and minP to the smallest (after creating the Primes)6 getters. getMaxP(), getMinP()(these return Prime objects), int getMaxPValue(), int getMinPValue()(these return the value as in 7- Setters. If you try to set minP to a Prime greater than maxP, then maxP should be set to that Prime and minP should be set to maxP. (example: minP is 7, maxp is 13 you try to set minP to 17, then maxp becomes 17 and minP will be 13.) will be set to the new value.
8- tostring
9- equals
10- method add that a accepts an integer and returns a MaxMin object with both maxp and minP increase by at least the integer (use add method used in prime).
11- method add that accepts a Prime object and adds it to both maxP and minP
A method add that accepts two Prime objects and adds the largest to maxp and the smallest to minP.
13 Tester to test every constructor and method in this class.
 Design a class MinMaxprime that has two private member variables that

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!