Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago