Question: 3 classes and a main program that asks the user to enter the required information. Sales tax and total charges should be calculated in separate

3 classes and a main program that asks the user to enter the required information. Sales tax and total charges should be calculated in separate methods inside of the appropriate class. Be sure to include comments describing what the code is doing. When completed, compress the folder containing all of the files associated with the program.

Problem Description

A dog groomer at Merlins Pet Grooming has asked you to create a program for her office to create invoices for her customers visits. When a customer brings their pet in for grooming, the clerk gets the Customers name, address, phone number and email address. The pets name, the type of pet, and the age of the pet are also collected. After the pet has been groomed, the clerk will determine the charges for the services, and print an invoice for the customer. The invoice should neatly display the Customers name, address, phone and email address. The invoice should also display the pets name, type and age. The charges, tax, and total should also be displayed. All calculations should take place in the class methods. All display should use method calls to get the methods from the classes to display the appropriate information. Do not accept any numbers that are less than or equal to zero. Calculate the sales tax using a constant equal to 0.0975 and limit the display to two decimal places.

So i have this program working good in python in one file i need some help to seperate each class and the main in one folder here is the code :

import sys # class - Customer Detail class CustomerDetails: name = '' address = '' phone = '' email = '' def getDetails(self): # getter function for Customer self.name = input('Enter the Name of Customer ') self.address = input('Enter the Address ') self.phone = input('Enter Phone Number ') self.email = input('Enter Email Address ') def print_details(self): # Print function for printing details of Customer print('************************************') print('********Customer Details************') print('Name : ', self.name) print('Address : ', self.address) print('Phone : ', self.phone) print('Email Id : ', self.email) # Class pet Details class PetDetails: pet_name = [] pet_type = [] pet_age = [] choice = 0 def getDetails(self): # getter for Pet Details self.choice = int(input('Enter the Number of Pet for Grooming ')) if self.choice >= 1: # Asking for number of Pet from Clerk to enter # because , it is mentioned in problem - Do not accept any numbers that are less than or equal to zero for i in range(self.choice): self.pet_name.append(input('Enter the Pet Name ')) self.pet_type.append(input('Enter the Type ')) self.pet_age.append(int(input('Enter the age of pet '))) else: # in case of Zero or less than zero terminating the session print('*****Enter at least one Pet******') sys.exit(0) # to exit def print_details(self): print('************************************') print('********Pet Details*****************') for i in range(self.choice): print('Pet Name : ', self.pet_name[i]) print('Type : ', self.pet_type[i]) print('Pet Age', self.pet_age[i]) # Class Bill generation class BillGeneration: charge = 0 sales_tax = 0 total_charge = 0 def getDetails(self): # getter for the Bill details self.charge = float(input('Enter the Charges for the services ')) def calculation(self): # calculating the total final bill self.sales_tax = self.charge * 0.0975 # don't know exactly how to count the sales tax and all tax # this calculation might be wrong , please update it according to your choice and decision self.total_charge = self.charge + self.sales_tax def print_details(self): print('************************************') print('Grand Total', "%.2f" % self.total_charge) # limiting the display to floating value of two class MerlinPet: # main program def main(self): cust_detail = CustomerDetails() # Creating Instance of Customer Details Class pet_detail = PetDetails() # Creating Instance of Pet Details Class bill = BillGeneration() # Creating Instance of Bill Class cust_detail.getDetails() # calling getDetails method of customer class so that clerk can input the details of customer pet_detail.getDetails() # calling getDetails method of PetDetails class so that clerk can input the details of pet bill.getDetails() # calling getDetails method of Bill Class so that clerk can input the total bill bill.calculation() # call method to calculate the bill # print all the final invoice here # Note : this all below lines can be shift into different method also, just for separating the concern print('*********************INVOICE*************************') cust_detail.print_details() pet_detail.print_details() bill.print_details() # create instance of Merlin pet (Main Class) mp = MerlinPet() mp.main() # instance has been created , so invoke main function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!