Question: Part 2 Imagine no Math ( 4 0 points ) Any number squared will produce a positive number, so there is no true square root

Part 2 Imagine no Math (40 points)Any number squared will produce a positive number, so there is no true square root of anegative number. Square roots of negative numbers can only be determined using theimaginary number called an iota, or i.In electrical engineering the letter 'i' is already used to represent the current therefore 'j' is usedto represent the imaginary number. The following program uses j also to represent theimaginary (1)1. Create a new program called, jIsOkay.java2. In the main() method use Scanner to ask the user to input a positive integerbetween 3 and 49 inclusive and assign it to the variable aNum3. Validate that aNum is an integer and within the required range.4. Use aNum as input to a method called mysteryNumber that randomly generatesand returns an integer x whose range is between -aNum and +aNum both inclusiveand assigns it back to xNum.5. Test whether xNum is positive or negative and then calculate and print out itssquare root formatted to two decimal places and with or without the imaginary j asappropriate.Sample runs:Enter an integer between 3 and 49 inclusive: yy is not an integer. Start over.Enter an integer between 3 and 49 inclusive: 10.410.4 is not an integer. Start over.Enter an integer between 3 and 49 inclusive: 22 is not within range. Start over.Enter an integer between 3 and 49 inclusive: 6767 is not within range. Start over.Enter an integer between 3 and 49 inclusive: 3Now try to find the square root of 0The square root of this non-negative number is 0.00Enter an integer between 3 and 49 inclusive: 3Now try to find the square root of 1The square root of this positive number is 1.00Enter an integer between 3 and 49 inclusive: 49Now try to find the square root of -9The square root of this negative number is 3.00j

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 Programming Questions!