[Solved]Python Code Question 1 General Instructions Create Class Called Lawnservice Takes Length W Q37033911
Python Code Question# 1
General Instructions
Create a class called LawnService that takes in the length andwidth 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 methodreturns the total cost to the customer.
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 this class? Onceyou have the data requirements figured out, detemine the methodsfor this class along with their algorithms. Finally determine whatdata needs to leave the class and what access methods you will needto write in order for that to happen.
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() thatwill create your first object. Send in to the 40 for the width, 30for the length and for the status “poor”.
Call your method to determine the application, followed by themethod to determine the total. Next call the method to return thetotal and print that to the screen. If your total is 720 your codeis working. If your total is not this go back and check yourdecision structure in determine application. Next check yourdetermine total method to make sure your math is correct. If youare unable to find your error by analzying each of these methods,place print statements within your methods to show you the valuesof your variables as your class executes. As soon as you get yourcode running and working, copy your code for the class only toNotepad++ to presearve the spacing followed by a copy and pasteinto MPL. Click on the submit button to run your 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.
Python Code Question# 2
General Instructions
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.
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.
Expert Answer
Answer to Python Code Question# 1 General Instructions Create a class called LawnService that takes in the length and width of a y… . . .
OR

