7.20 Gene's Green Part 5 - Tee Area (Individual Assignment) This is an Individual Assignment. You must
Question:
7.20 Gene's Green Part 5 - Tee Area (Individual Assignment)
This is an Individual Assignment. You must complete this assignment on your own.
Do not collaborate or share code with other students.
Do not copy and paste code from anywhere.
Do not use any resources outside of those provided in the course materials.
Do not use any language features that have not been covered to this point in the course materials.
If you get stuck or need help, please use only the help systems provided in this course.
Required Skills Inventory
Write a method according to given specifications
Write a method that takes arguments and returns a value
Write a method that calls another method
Use parameter variables in a method body
Write a return statement
Use math operators to construct an expression
Problem Description and Given Info
Gene's Green Golf Center is remodeling their golf course, and has hired you to help write a program that will be used to determine what materials will be needed to complete the project. There are 18 holes on the golf course, but Gene likes to keep things simple, so every hole looks very similar. A typical Hole at Gene's Green Golf Center looks like the image below - only the length and width change.
Given the length and width of a hole (in yards), Gene needs to know the following:
Total square yards of rough sod, rounded up to the nearest square yard.
Total square yards of smooth sod, rounded up to the nearest square yard.
Tons of sand needed for the sand trap (US tons), rounded up to the nearest ton.
Number of bushes needed, rounded down to the nearest bush.
Other Details
Gene will provide the length and width of the hole in yards.
The Tee area is a circle with a diameter that is always one-third of the course width.
The Putting Green is a circle with a diameter that is always two-thirds of the course width.
The Sand Trap is a circle with a diameter that is always one-quarter of the course width.
The Sand Trap is always two foot deep.
Sand weighs 80 lbs. per cubic foot.
The course is surrounded on all sides by Bushes. Gene wants to plant one bush for every yard of the course perimeter, leaving two openings - one for the Entry Trail, and one for the Exit Trail. These two openings are both one yard wide.
In preparation for this project, you will need to implement some basic methods that we will use to make things easier when you are completing the final part of this project. For this Individual Assignment you must implement the following method.
Part 5 - areaOfTee Method
Write a public static method named areaOfTee that takes one one argument (a double) and returns a value (double). The argument will be the width of a course hole (see diagram above). When called, this method should compute and return the totalTeeArea for a hole with a width given by the argument value (see the Other Details above). In the body of this method , call the areaOfCircle method (that you wrote for a previous part of this project) to compute the totalTeeArea.
Examples
areaOfTee(3.0) should return the approximate value 0.79 areaOfTee(8.0) should return the approximate value 5.59 areaOfTee(7.5) should return the approximate value 4.91
Helpful Hints:
You may include and call any methods that you have defined for the previous parts of this challenge.
You may wish to write some additional code (in the main method) to test your method.
There should be no print (or println or printf) statements in your areaOfTee method.
There should be no calls to any Scanner methods in your areaOfTee method.
Remember that, in Java, when you divide and int by and int, the result will always be an int. For example (1/3) will evaluate to 0.
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill