Question: Write a method named areaCircle, with the following requirements: a ) public and static b ) has a formal parameter type 'double' c ) returns
Write a method named areaCircle, with the following requirements:
a public and static
b has a formal parameter type 'double'
c returns a value type "double"
e if the value of the formal parameter is positive, return the area of a circle with such radius
f if the value of the formal parameter is negative or zero, print "Invalid radius" and return zero
Note: just need to write the method, not the main program
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
