[Solved]Python Coding 1 Create Class Called Lawnservice Takes Length Width Yard Along Current Stat Q37027290
python coding:
1) Create a class called LawnService that takes in the lengthand width of a yard, along with the current state of the yard. Thecurrect state can be: poor, acceptable or great. Within this classinclude a constructor that will assign these values to attributes.Additionally create three methods that will be named and do thefollowing:
*DetermineApplication: This method will focus on the lawn statusattribute. If the status is poor, the lawn company will need tovisit the household twice a month for 6 months. If the status isacceptable, the lawn company will need to visit once a month for 6months. Finally if the lawn is great, the lawn company will visitevery other month for 6 months.
*DetermineTotal: This method will use the number of applicationsas determined by the method DetermineApplication to calculate thetotal cost to the customer. The calculation will first determinethe area using the lenght and width. For each square foot of lawnthe lawn company charges $0.05. The total cost will include thecost for each application by how many applications are necessary asdetermined by DetermineApplication.
*ReturnTotal: This method returns the total cost to thecustomer.
Analyzing the Requiements
Before you code, make sure you have identifed what the datarequirements are for this class. Is there any data that needs tocome in to the class in order for it to work? Is there any dataprocessed in this class? What data needs to leave thisclass?
Once you have the data requirements figured out, detemine themethods for this class along with their algorithms.
Finally determine what data needs to leave the class and whataccess methods you will need to write in order for that tohappen.
Writing the Code
After figuring out what your class needs to do, open up yourPython compiler and create your constructor to declare andinitialize your attributes. Then code your methods followed by theaccess methods.
To test this in the compiler, create main() that will createyour first object. Send in to the 40 for the width, 30for the length and for the status “poor”. Call your method todetermine the application, followed by the method to determine thetotal. Next call the method to return the total and print that tothe screen. If your total is 720 your code is working.
If your total is not this go back and check your decisionstructure in determine application. Next check your determine totalmethod to make sure your math is correct. If you are unable to findyour error by analzying each of these methods, place printstatements within your methods to show you the values of yourvariables as your class executes.
As soon as you get your code running and working, copy your codefor the class only to Notepad++ to presearve the spacing followedby a copy and paste into MPL. Click on the submit button to runyour code in MPL.
Testing and Output
There is no output for this class other than the words Corrrectand Great Job if you created the class correctly. MyProgramming Labwill run your code and create an object based on it.
2) Using the your LawnService class you created above, copy thecode you wrote and paste it into the solution area. Then create anobject based on your class. Name your object MyLawn. When creatingyour object use great as the lawn status, 50 as the length and 20as the width for your parameters or the values that need to be sentinto the class.
Expert Answer
Answer to python coding: 1) Create a class called LawnService that takes in the length and width of a yard, along with the current… . . .
OR

