Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

JAVA HELP This program calculates the cost of putting a fence all the way around

ID: 3781730 • Letter: J

Question

JAVA HELP

This program calculates the cost of putting a fence
all the way around a rectangular yard AND putting sod everywhere in the yard
EXCEPT for a circular flower bed.
Input consists of the length and width of the yard and the radius of the
flower bed (all double and all in feet).
The cost of fencing (a constant) is $2.50 per foot and the cost of sod is
$1.50 per square foot (another constant).
Fencing can only be purchased in one foot sections,
and sod can only be purchased by the square foot. (Remember to use ceil)

If you use this input (not realistic, but easier for my to verify)
length 6.2, width 3.4, radius 1.2
Then cost of fence is $50, cost of sod is $25.5, total cost is $75.5

With length 15.6,  width 12.7, radius 3
Cost of fence is $142.5, cost of sod is $255.0, total cost is $397.5

With length 100,  width 30, radius 10
Cost of fence is $650.0, cost of sod is $4029.0, total cost is $4679.0

NOTE the formatted output. DO NOT give more than two decimal places when you are outputting a cost.

Explanation / Answer

Sample Input :

15.6
12.7
3

Sample Output :