Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project Challenge: Gene's Green Golf Center DIRECTIONS Gene's Green Golf Center is remodeling their golf course, and has hired you to help determine what will

Project Challenge: Gene's Green Golf Center
DIRECTIONS
Gene's Green Golf Center is remodeling their golf course, and has hired you to help determine what will be needed to complete the project. There are 18 holes on the golf course, but Gene is not very creative, so every hole looks similar to this, only the length and width change:
Diagram of one hole of golf course. The area is rectangular, bordered by bushes except for an entry trail to the tee-off area. The tee-off area and hole area are circular areas of smooth green grass. There is a circular sand trap near the hole area. The sand trap is bordered on half of the circle by a brick retaining wall. The rest of the course area is covered by rough sod.
Gene would like you to design and implement a small program that calculates the following information for a course hole and generates a well-formatted report.
Total square yards of rough sod, rounded up to nearest square yard.
Total square yards of smooth green sod, rounded up to nearest square yard.
Tons of sand needed for the sand trap (US Tons), rounded up to nearest ton.
Number of bricks needed for the retaining wall, rounded up to nearest brick.
Number of bushes needed, rounded down to nearest bush.
How long the given hole will take to mow each week in minutes, rounded up to nearest minute.
Here is some information you may need:
Gene will provide the length and width of the hole in yards. Your program should ask for this information in that order (length followed by width). Your program should expect a float type number for these quantities. This should be the only inputs needed to generate the report.
The hole green and the tee-off green areas each are circles with a diameter of half of the course width.
The sand trap is a circle with a diameter of one-third of the width of the course width.
The sand trap is 1 foot deep.
Sand weighs 100 lbs. per cubic foot.
The brick retaining wall is one brick deep and 3 bricks tall. It covers half of the circumference of the sand trap. Each brick is 12 inches long.
The course is surrounded on all sides by bushes. Gene wants to plant 1 bush for every yard of the course perimeter, leaving 2 spots empty for the entry and exit trails.
It takes 0.5 seconds to mow the grass of each square yard of rough green sod (it's a very large, fast mower!). It takes double this time for the smooth green, because the mower makes 2 passes to make it very even. The area covered by the bushes should be included in the mowing time calculation. The area covered by the sand trap should be excluded from the mowing time. You can ignore the contribution of the retaining wall and entry/exit trails.
For example, with the following inputs:
Enter Course Length: 20
Enter Course Width: 10
the output should look exactly like this:
Total square yards of rough sod: 152
Total square yards of smooth sod: 40
Tons of sand: 4
Number of retaining wall bricks: 48
Number of bushes: 58
Total Mowing Time (mins): 2
Note that because floating point values often incur rounding errors, the output might not be completely accurate. This will not affect the grading. However, please make your outputs look like the example above, so that the automated system can evaluate your results.
Your program must:
Take console input from the user in the form of the course length followed by the course width.
Define at least 4 new functions to accomplish this task.
Things to think about when youre designing and writing this program:
Identify the things the program will need to do, like calculate the total square yards of rough sod, and calculate the total square yards of smooth sod, etc. Then design and write a function for each of these things the program must do.
For each function your design and write, make sure that function does only one thing. For example, you may design and write a function to calculate the total square yards of rough sod, calculating the total square yards of rough sod is one thing. This function should not also do a second thing, like display the total square yards of rough sod.
For each function that you design and write, give that function a name that clearly describes what that function does. For example, a function that calculates the total square yards of rough sod, may be named calculate_sq_yrds_rough_sod.
For each function that you design and write, ask yourself "What things does this function need to know in order to be able to do what this function should do?" Take, for example, a function that will calculate the total square yards of rough sod. What things does this function need to know in order to be able to calculate the total square yards of rough sod? This function will need to know the length and the width of the course. The things the function needs to know should be passed to the function as arguments, so the function will need some parameter variables to store these argument values that are passed to it. Some functions may not need to know anything in order to do what they should do, but those that do should take arguments. In general, avoid the use of global variables.
For each function that you design and write, ask yourself "what do I need to get back from this function?". For example, what do I need to get back from the calculate_sq_yrds_rough_sod. function? I need the function to give me the number of square yards of rough sod required for this hole. Since this function must give something back when it is called, the function should use a return statement to return that value.
Follow this recipe to organize your code: (1) define your functions, (2) collect all your input (3) calculate the required results (4) output the results.
Spend some time choosing your variable names carefully. Names should be descriptive.
Take advantage of variables to name values whose purpose may not be obvious.
Take advantage of variables by breaking any complex expressions down into a set of simpler expressions and storing the intermediate results in variables.

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

Is willing to challenge constructively and be challenged.

Answered: 1 week ago