Question: In this problem, you're given a partially completed program, and you need to update and complete the program to produce the desired output. A landscaping
In this problem, you're given a partially completed program, and you need to update and complete the program to produce the desired output.
A landscaping company has determined that for every square feet of garden space, bag of mulch and hours of labor are required.
The company charges $ per hour for labor plus a flat $ project fee.
This program asks the user to enter the square feet of garden space to be mulched and the price of mulch per bag.
The program will then display:
The number of bags of mulch required
The hours of labor required
The cost of the mulch
The cost of the labor per hour charges plus project fee
The total cost of the landscaping job.
NOTE: This company charges the customer for quarter days hours and does not charge for less than that. So you should base the hours of labor on the number of bags of mulch. For example, if a job requires bags of mulch, it will also require hours of labor.
The instructor has provided a file called LabPFillThisIn.py Download that file and rename it LabPpy
Copy that file into your PyCharm project.
Change the program header to include your name and the date.
Replace every instance of Fill this in with correct code that will enable the program to do the required calculations and display the results.
Note there are GLOBAL CONSTANTS at the top of the program. You should use those constants wherever it makes sense to use them.
You should eventually be able to run the program with no errors and produce results like the sample output. Note that all monetary values should have digits after the decimal point.
Sample Output:
Enter garden space in square feet:
Enter mulch price per bag:
Bags of mulch:
Hours of labor:
Mulch charges: $
Labor charges: $
Total cost: $
Run this program using the PyCharm Terminal. Take a screenshot of the Terminal that includes the line showing where you started the program run with the results. Name the screenshot LabPouput.jpg
import math
FillThisIn None
# Global constants for paint job estimator
FEETPERBAG
HOURSPERBAG
LABORCHARGE
PROJECTFEE
# main module
def main:
# Ask the user for the garden space in square feet
gardenspace FillThisIn
# Ask the user for the mulch price
mulchprice FillThisIn
# Calculate number of bags needed
numbags math.ceilgardenspace FEETPERBAG
# Calculate labor hours hours labor for every bag of mulch
hourslabor FillThisIn
# Calculate labor charge including project fee
costlabor FillThisIn
# Calculate mulch cost
mulchtotalcost numbags mulchprice
# Print cost estimate
showCostEstimatenumbags, hourslabor, mulchtotalcost costlabor
# The showCostEstimate function accepts bagsmulch, laborhours,
# mulchtotal, labortotal as arguments and displays the corresponding
# data.
def showCostEstimateFillThisIn:
# Calculate total cost
totalCost FillThisIn
# Display results
print fBags of mulch: FillThisIn
print fHours of labor: FillThisIn
print fMulch charges: $mulchtotal:f
print fLabor charges: $FillThisIn
print fTotal cost: $FillThisIn
# Call the main function.
main
import math
FillThisIn None
# Global constants for paint job estimator
FEETPERBAG
HOURSPERBAG
LABORCHARGE
PROJECTFEE
# main module
def main:
# Ask the user for the garden space in square feet
gardenspace FillThisIn
# Ask the user for the mulch price
mulchprice FillThisIn
# Calculate number of bags needed
numbags math.ceilgardenspace FEETPERBAG
# Calculate labor hours hours labor for every bag of mulch
hourslabor FillThisIn
# Calculate labor charge including project fee
costlabor FillThisIn
# Calculate mulch cost
mulchtotalcost numbags mulchprice
# Print cost estimate
showCostEstimatenumbags, hourslabor, mulchtotalcost costlabor
# The showCostEstimate function accepts bagsmulch, laborhours,
# mulchtotal, labortotal as arguments and displays the corresponding
# data.
def showCostEstimateFillThisIn:
# Calculate total cost
totalCost FillThisIn
# Display results
print fBags of mulch: FillThisIn
print fHours of labor: FillThisIn
print fMulch charges: $mulchtotal:f
print fLabor charges: $FillThisIn
print fTotal cost: $FillThisIn
# Call the main function.
main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
