Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Prompt the user to enter the radius of a circle, should be an int. The radius needs to be greater than 0. If the user
Prompt the user to enter the radius of a circle, should be an int. The radius needs to be greater than 0. If the user enters a positive integer, print the area of the circle. Use Math.PI * radius * radius to calculate the area. If the user enters 0 or less print a message that the radius must be greater than 0.
Sample output 1:
Please enter the radius for your circle
10
The area of the circle is 314.1592653589793
Sample output 2:
Please enter the radius for your circle
-10
The radius must be greater than 0.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started