Question: Write a java program that takes the radius value (r) of the circle as input and calculates the area denoted in red color based on

Write a java program that takes the radius value (r) of the circle as input and calculates the area denoted in red color based on the radius value. In the end, the program should print the area of the shape designated in red with 2 digits after the decimal part.

  • HINT: The area of a circle with radius r is pi * r * r
  • HINT: The area of a square is a * a when the edge is a
  • HINT: You can take the PI value as 3.14

Input Format

The input data can be a real number, r

Constraints

10n 100

Output Format

If the given input r is 10, the program should print The red area is 86.00

Sample Input 0

10 

Sample Output 0

The red area is 86.00 

Sample Input 1

5 

Sample Output 1

The red area is 21.50

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