subject

I need to create a method named "root positive". which will either print the square root of the number passed to it or if the number is less than zero, it will print out the statement "Number must not be negative."? 1. Ask the user to input a number of type double which you will find the square root of the number.

2. Create a method called rootPositive which will either print the square root of the number passed to it or if the number is less than zero, it will print out the statement "Number must not be negative.".

3. Call your rootPositive method and pass to it the number the user enetered.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:00
Suppose s, t, and w are strings that have already been created inside main. write a statement or statements, to be added to main, that will determine if the lengths of the three strings are in order by length, smallest to largest. that is, your code should determine if s is strictly shorter than t, and if t is strictly shorter than w. if these conditions hold your code should print (the boolean value) true. if not, your code should print false. (strictly means: no ties) example: if s, t, and w are "cat", "hats", and "skies" your code should print true - their lengths are 3-4-5; but if s, t, and w are "cats" "shirt", and "trust", then print false - their lengths are 4-5-5 enter your code in the box below
Answers: 2
question
Computers and Technology, 23.06.2019 13:00
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
You know the right answer?
I need to create a method named "root positive". which will either print the square root of the numb...
Questions
question
Mathematics, 12.10.2020 19:01
question
Physics, 12.10.2020 19:01
question
Physics, 12.10.2020 19:01
question
Biology, 12.10.2020 19:01
question
Mathematics, 12.10.2020 19:01
Questions on the website: 13722359