|
| 1 | +# Laundry Service Class |
| 2 | + |
| 3 | +## Overview |
| 4 | +The LaundryService class is designed to manage customer details and calculate charges for a cloth and apparel cleaning service. It provides methods to create customer-specific instances, print customer details, calculate charges based on cloth type, branding, and season, and print final details including the expected day of return. |
| 5 | + |
| 6 | +## Class Structure |
| 7 | +### Methods |
| 8 | +1. `__init__(name, contact, email, cloth_type, branded, season)`: Initializes a new customer instance with the provided details and assigns a unique customer ID. |
| 9 | + - Parameters: |
| 10 | + - `name`: String, name of the customer. |
| 11 | + - `contact`: Numeric (integer), contact number of the customer. |
| 12 | + - `email`: Alphanumeric (string), email address of the customer. |
| 13 | + - `cloth_type`: String, type of cloth deposited (Cotton, Silk, Woolen, or Polyester). |
| 14 | + - `branded`: Boolean (0 or 1), indicating whether the cloth is branded. |
| 15 | + - `season`: String, season when the cloth is deposited (Summer or Winter). |
| 16 | + |
| 17 | +2. `customerDetails()`: Prints out the details of the customer, including name, contact number, email, cloth type, and whether the cloth is branded. |
| 18 | + |
| 19 | +3. `calculateCharge()`: Calculates the charge based on the type of cloth, branding, and season. |
| 20 | + - Returns: |
| 21 | + - Numeric, total charge for cleaning the cloth. |
| 22 | + |
| 23 | +4. `finalDetails()`: Calls `customerDetails()` and `calculateCharge()` methods within itself and prints the total charge and the expected day of return. |
| 24 | + - Prints: |
| 25 | + - Total charge in Rupees. |
| 26 | + - Expected day of return (4 days if total charge > 200, otherwise 7 days). |
| 27 | + |
| 28 | +## Example Usage |
| 29 | +```python |
| 30 | +# Example usage: |
| 31 | +name = input("Enter customer name: ") |
| 32 | +contact = int(input("Enter contact number: ")) |
| 33 | +email = input("Enter email address: ") |
| 34 | +cloth_type = input("Enter cloth type (Cotton/Silk/Woolen/Polyester): ") |
| 35 | +branded = bool(int(input("Is the cloth branded? (Enter 0 for No, 1 for Yes): "))) |
| 36 | +season = input("Enter season (Summer/Winter): ") |
| 37 | + |
| 38 | +customer = LaundryService(name, contact, email, cloth_type, branded, season) |
| 39 | +customer.finalDetails() |
| 40 | + |
| 41 | + |
| 42 | +markdown |
| 43 | +Copy code |
| 44 | +# Laundry Service Class |
| 45 | + |
| 46 | +## Overview |
| 47 | +The LaundryService class is designed to manage customer details and calculate charges for a cloth and apparel cleaning service. It provides methods to create customer-specific instances, print customer details, calculate charges based on cloth type, branding, and season, and print final details including the expected day of return. |
| 48 | + |
| 49 | +## Class Structure |
| 50 | +### Methods |
| 51 | +1. `__init__(name, contact, email, cloth_type, branded, season)`: Initializes a new customer instance with the provided details and assigns a unique customer ID. |
| 52 | + - Parameters: |
| 53 | + - `name`: String, name of the customer. |
| 54 | + - `contact`: Numeric (integer), contact number of the customer. |
| 55 | + - `email`: Alphanumeric (string), email address of the customer. |
| 56 | + - `cloth_type`: String, type of cloth deposited (Cotton, Silk, Woolen, or Polyester). |
| 57 | + - `branded`: Boolean (0 or 1), indicating whether the cloth is branded. |
| 58 | + - `season`: String, season when the cloth is deposited (Summer or Winter). |
| 59 | + |
| 60 | +2. `customerDetails()`: Prints out the details of the customer, including name, contact number, email, cloth type, and whether the cloth is branded. |
| 61 | + |
| 62 | +3. `calculateCharge()`: Calculates the charge based on the type of cloth, branding, and season. |
| 63 | + - Returns: |
| 64 | + - Numeric, total charge for cleaning the cloth. |
| 65 | + |
| 66 | +4. `finalDetails()`: Calls `customerDetails()` and `calculateCharge()` methods within itself and prints the total charge and the expected day of return. |
| 67 | + - Prints: |
| 68 | + - Total charge in Rupees. |
| 69 | + - Expected day of return (4 days if total charge > 200, otherwise 7 days). |
| 70 | + |
| 71 | +## Example Usage |
| 72 | +```python |
| 73 | +# Example usage: |
| 74 | +name = input("Enter customer name: ") |
| 75 | +contact = int(input("Enter contact number: ")) |
| 76 | +email = input("Enter email address: ") |
| 77 | +cloth_type = input("Enter cloth type (Cotton/Silk/Woolen/Polyester): ") |
| 78 | +branded = bool(int(input("Is the cloth branded? (Enter 0 for No, 1 for Yes): "))) |
| 79 | +season = input("Enter season (Summer/Winter): ") |
| 80 | + |
| 81 | +customer = LaundryService(name, contact, email, cloth_type, branded, season) |
| 82 | +customer.finalDetails() |
| 83 | +Usage Instructions |
| 84 | +Create an instance of the LaundryService class by providing customer details as parameters to the constructor. |
| 85 | +Use the finalDetails() method to print the customer details along with the calculated charge and expected day of return. |
| 86 | + |
| 87 | + |
| 88 | +Contributors |
| 89 | +(Rohit Raj)[https://github.com/MrCodYrohit] |
| 90 | + |
| 91 | + |
0 commit comments