Question: import java.util.Scanner; class demo public static void main(String[l args) final double PI 3.14159; Scanner scan new Scanner (System.in); System.out.print(Enter the top-left coordinates for the rectangular

 import java.util.Scanner; class demo public static void main(String[l args) final doublePI 3.14159; Scanner scan new Scanner (System.in); System.out.print("Enter the top-left coordinates for

import java.util.Scanner; class demo public static void main(String[l args) final double PI 3.14159; Scanner scan new Scanner (System.in); System.out.print("Enter the top-left coordinates for the rectangular portion: "); int x1 - scan.nextlnt(); int y1 scan.nextlnt) System.out.print("Enter the bottom-right coordinates for the rectangular portion: "); int x2 = scan.nextlnt(); int y2 - scan.nextlnt(); System.out.print("Enter the radius of the circular portion of the field: "); int radius scan.nextlnt) int side1 x2 - x1; int side2y1 - y2; int perimeter 2*side1 + 2*side2; double circumference - 2 * PI * radius; double fenceLength-perimeter 2 * radius 3.0/4 * circumference; System.out.println("You will need "+ fenceLength" meters of fence around this field."); int rectangleArea-side1 * side2; double circleArea -Pl * radius * radius; double area rectangleArea 3.0/4*circleArea; System.out.println("You have to cover" area + " square meters with grass."); double nbBags area /112; int nbBagsAslnt - (int) nbBags; nbBagsAslnt - nbBagsAslnt 1; System.out.println("You will need "nbBagsAslnt "bags of grass seeds for this."); int cost - nbBagsAslnt * 14; System.out.println("The total cost for seeds will be $" cost "before tax.")

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!