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 Imagine no Math pointsAny 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 iIn 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 Create a new program called, jIsOkay.java In the main method use Scanner to ask the user to input a positive integerbetween and inclusive and assign it to the variable aNum Validate that aNum is an integer and within the required range 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 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 and inclusive: yy is not an integer. Start over.Enter an integer between and inclusive: is not an integer. Start over.Enter an integer between and inclusive: is not within range. Start over.Enter an integer between and inclusive: is not within range. Start over.Enter an integer between and inclusive: Now try to find the square root of The square root of this nonnegative number is Enter an integer between and inclusive: Now try to find the square root of The square root of this positive number is Enter an integer between and inclusive: Now try to find the square root of The square root of this negative number is j
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
