Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PYTHON !HELP!! Purpose: To write a function that performs a subtask and returns an answer Degree of Dificulty: Easy Terri, a homeowner, wants to estimate
PYTHON !HELP!!
Purpose: To write a function that performs a subtask and returns an answer Degree of Dificulty: Easy Terri, a homeowner, wants to estimate how much it would cost to repaint her backyard fence. Fortunately for her, her backyard is rectangular, which makes computations easy. She only needs to consider the cost of paint for the fence on three sides (the house is where the fourth fence side would be) house length length width Figure 1 Top-down view of a fence to be painted that marks the rectangular backyard of a house Write a Python function fence_cost that takes four parameters as input and returns the total cost of painting both the inside and the outside of the fence. The four parameters should be the width of the fence in metres (m), the length of the fence in m, the height of the fence in m, and the cost of paint per square metre. Remember to include an appropriate docstring which states the function's purpose, parameter(s) and return valuels) Outside of the function, prior to calling it, ask the user to input values for each of the function arguments from the console. You may assume that the user supplies valid input. Call the fence_cost function with the arguments you read from the console and output its return value to the console Sample Run Here is an example of how your program's console output might look. Green text was entered by the user: blue text came from data returned by the function. Enter the width of the fence area in metres 10.5 Enter the length of the fence area in metres 12.0 Enter the height of the fence in metres 1.685 Enter the cost oI palnt per square metre 2.50 The fence will cost $284.625 to paintStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started