Question

In: Computer Science

Submit: One python file __name__ == "__main__" Screenshot of sample output Be sure to: Comment your...

Submit:

  • One python file __name__ == "__main__"
  • Screenshot of sample output

Be sure to:

  • Comment your code, classes and functions! Practice practice practice!
  • Use meaningful variables
  • If you do not I will remove points

Dog Walker Program

  • Create a program for a Dog Walking company to keep track of its employees, customers, and customer dogs
  • You will need the following classes:
    • Person
      • With the following attributes:
        • name
        • id_number
        • dogs : list of Dog objects
      • With the appropriate setters and getters
      • With the following subclasses:
        • DogWalker(Person)
          • With the following attributes:
            • hourly_rate : float
          • With the appropriate setters and getters
        • Customer(Person)
          • With the following attributes
            • amount_owed : float, how much they currently owe
          • With the appropriate setters and getters
    • Dog
      • With the following attributes
        • name
        • breed
        • weight
        • hours_walked
      • With the appropriate setters and getters

Programming language: Python

requirement: please follow up the rules per demonstrated.

Solutions

Expert Solution

#Definingclass Person 
class Person:
#Defining function to return name of person
 def getName(self):
  return Person.name
  #Defining function to set name of person
 def setName(self,n):
  Person.name=n
  #Defining function to return id number of person
 def getID(self):
  return Person.id_number
  # function to set id number of person
 def setID(self,id):
  Person.id_number=id
  # function to set list of details of dogs owned person
 def setDogs(self,doglist):
  Person.dogs=doglist
  # function to return list of details of dogs owned person
 def getDogs(self):
  return Person.dogs
  #class to define dog walker which is sub class of person
class DogWalker(Person):
    # function to set hourly rate of dog walker
 def setHourly_rate(self,rate):
  DogWalker.hourly_rate=rate
  # function to get hourly rate of dog walker
 def getHourly_rate(self):
  return DogWalker.hourly_rate 
  #class to define sustomer which is sub class of person
class Customer(Person):
    # function to set amount owed by customer
 def setAmount_owed(self,amount):
  Customer.DogWalker=amount
  # function to get amount owed by customer
 def getAmount_owed(self):
  return Customer.DogWalker
  #Class to define properties of dog
class Dog:
   # function to set name of dog
 def setName(self,dogname):
  Dog.name=dogname
  # function to get name of dog
 def getName(self):
  return Dog.name
  # function to set breed of dog
 def setbreed(self,breed):
  Dog.breed=breed
  # function to get breed of dog
 def getbreed(self):
  return Dog.breed
  # function to set weight of dog
 def setweight(self,weight):
  Dog.weight=weight
  # function to get weight of dog
 def getweight(self):
  return Dog.weight
  # function to set hours walked by dog
 def sethours_walked(self,hours):
  Dog.hours_walked=hours
  # function to get hours walked by dog
 def gethours_walked(self):
  return Dog.hours_walked
if __name__ == "__main__":
 customer1=Customer()
 # creating objects of Dog,Dogwalker,customer
 dog1 =Dog()
 dog2 =Dog()
 dogwalker1 =DogWalker()
 doglist=[]
 #Entering details of customer
 print("Enter the details of customer:")    
 customer1.setName(input("NAME:"))
 customer1.setID(input("ID:"))
 customer1.setAmount_owed(input("Amount owed: "))
 #Entering details of first dog
 print("Enter details of first dog")
 dog1.setName(input("Enter dog name:"))
 dog1.setbreed(input("Enter dog breed:"))
 dog1.setweight(input("Enter weight:"))
 dog1.sethours_walked(input("Hours walked:"))
 #Appending details of first dog
 doglist.append(dog1.getName())
 doglist.append(dog1.getbreed())
 doglist.append(dog1.getweight())
 doglist.append(dog1.gethours_walked)
 #Entering details of second dog
 print("Enter ddetails of second dog")
 dog2.setName(input("Enter dog name:"))
 dog2.setbreed(input("Enter dog breed:"))
 dog2.setweight(input("Enter weight:"))
 dog2.sethours_walked(input("Hours walked:"))
  #Appending details of second dog
 doglist.append(dog2.getName())
 doglist.append(dog2.getbreed())
 doglist.append(dog2.getweight())
 doglist.append(dog2.gethours_walked)
 customer1.setDogs(doglist)
  #Entering details of dog walker
 print("Enter the details of Dog walker:")   
 dogwalker1.setName(input("NAME:"))
 dogwalker1.setID(input("ID:"))
 dogwalker1.setHourly_rate("Hourly rate: ")
 #PRinting output
 print("Details of customer:")
 print("Name: ",customer1.getName())
 print("ID: ",customer1.getID())
 print("Amount owed: ",customer1.getAmount_owed())
 print("Dogs details: \n",customer1.getDogs())
 print("Details of Dog walker:")
 print("Name: ",dogwalker1.getName())
 print("ID: ",dogwalker1.getID())
 print("Hourly rate: ",dogwalker1.getHourly_rate())
 

Sample output


Related Solutions

Submit: One python file __name__ == "__main__" Screenshot of sample output Be sure to: Comment your...
Submit: One python file __name__ == "__main__" Screenshot of sample output Be sure to: Comment your code, classes and functions! Practice practice practice! Use meaningful variables If you do not I will remove points Dog Walker Program Create a program for a Dog Walking company to keep track of its employees, customers, and customer dogs You will need the following classes: Person With the following attributes: name id_number dogs : list of Dog objects With the appropriate setters and getters...
Use Python to Complete the following on a single text file and submit your code and...
Use Python to Complete the following on a single text file and submit your code and your output as separate documents. For each problem create the necessary list objects and write code to perform the following examples: Sum all the items in a list. Multiply all the items in a list. Get the largest number from a list. Get the smallest number from a list. Remove duplicates from a list. Check a list is empty or not. Clone or copy...
using C thank you Must submit as MS Word file with a screenshot of the 3...
using C thank you Must submit as MS Word file with a screenshot of the 3 outputs. Run your program 3 times. the output must be in a screenshot not typed for the each time you run the program. thank you Modify the code below to implement the program that will sum up 1000 numbers using 5 threads. 1st thread will sum up numbers from 1-200 2nd thread will sum up numbers from 201 - 400 ... 5th thread will...
Please submit 1) the source code (.java file), and 2) the screenshot of running results of...
Please submit 1) the source code (.java file), and 2) the screenshot of running results of each question. (Factorials) Write an application that calculates the factorial of 20, and display the results. Note: 1) The factorial of a positive integer n (written n!) is equal to the product of the positive integers from 1 to n. 2) Use type long. (Largest and Smallest Integers) Write an application that reads five integers and determines and prints the largest and smallest integers...
Name your program file warmup.py Submit your working Python code to your CodePost.io account. In this...
Name your program file warmup.py Submit your working Python code to your CodePost.io account. In this challenge, establish if a given integer num is a Curzon number. If 1 plus 2 elevated to num is exactly divisible by 1 plus 2 multiplied by num, then num is a Curzon number. Given a non-negative integer num, implement a function that returns True if num is a Curzon number, or False otherwise. Examples is_curzon(5) ➞ True 2 ** 5 + 1 =...
python Create a new file name condition_quiz.py. Add a comment with your name and the date....
python Create a new file name condition_quiz.py. Add a comment with your name and the date. Prompt the user to enter the cost. Convert the input to a float. Prompt the user for a status. Convert the status to an integer Compute the special_fee based on the status. If the status is 0, the special_fee will be 0.03 of the cost. Else if the status is 1, the special_fee will be 0.04 of the cost. Else if the status is...
​​​​Python Create a new file named compute_cost.py. Write your name and date in a comment. Create...
​​​​Python Create a new file named compute_cost.py. Write your name and date in a comment. Create a variable named base_fee and set the value to 5.5. Prompt the user for the zone. The zones can be an integer value from 1 to any value for the zone. Convert the zone to an integer. Display the zone on the SenseHat with a scroll speed of 0.3, make the text blue, and the background yellow. Scroll "The zone is " and the...
2. Add a title comment block to the top of the new Python file using the...
2. Add a title comment block to the top of the new Python file using the following form # A brief description of the project 3. Ask user - to enter the charge for food 4. Ask user - to enter theTip for server ( remember this is a percentage , the input therefore should be decimal. For example, for a 15% tip, 0.15 should be entered) 5. Ask user - to enter the Tax amount ( this is a...
In Python write a program that prompts the user for a file name, make sure the...
In Python write a program that prompts the user for a file name, make sure the file exists and if it does reads through the file, count the number of times each word appears and then output the word count in a sorted order from high to low. The program should: Display a message stating its goal Prompt the user to enter a file name Check that the file can be opened and if not ask the user to try...
in LINUX Inspect the login.defs file in your VM and provide a screenshot showing: LOGIN_RETRIES and...
in LINUX Inspect the login.defs file in your VM and provide a screenshot showing: LOGIN_RETRIES and LOGIN_TIMEOUT PLEASE SHOW THE STEPS
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT