Generation

generate functionFri, 05 May 2023

Create a program Python code demonstrating classes, inheritance, and polymorphism for a sign-in process, consisting of the following steps: Sign in Step 1: Each customer is advised to enter the login id and password for the sign in, the mobile number has 10 digits starting with 0. The Password must initiate with alphabets followed by either one of @, & and ending with numeric. Step 2: Post Successful Login the User must be presented with a variety of options to Proceed (Home Page): 2.1 Ordering, 2.2 Summary of Transactions 2.3 Logout Post Selecting the Option of 2.1 the User must be taken to the Ordering Page. In the ordering page, the following options should be offered: 1 Dine in 2 Order Online 3 Go To Login Page In case of Selecting the Option 2, the User must be taken to the next page, where the following options should be offered: 1 Self-Pickup 2 Home Delivery 3 Go To Previous Menu After the user successfully selects the ordering mode, the user should be presented with the menu in the form of: ID Name Price 1 XXXX XX 2 XXXX XX 3 XXXX XX 4 XXXX XX 5 XXXX XX 6 XXXX XX 7 Checkout Please note: • The menu will only have 6 items for the Click and collect and delivery modes. • If dine in mode is selected the user menu should have 6 items followed by 3 drinks items presented after the Food Menu. • The user should be able to order as many items as they wish. To close the Food menu and proceed to the Drink Menu the user needs to select option 7. To close the Drink Menu and proceed to the Checkout the user needs to select option 4. • Post Checkout the user must be advised with the total amount needed to be paid. • The user will then be provided with three options: o Proceed with payment o Cancel order Note: User must not be allowed to proceed for the Delivery option if the user has not mentioned their address during the signup process and must be asked to add the same before proceeding for the delivery or taken back to the Ordering Menu to select other option. A- Calculation for the Amount Need to be paid: 1- Dine in mode: Dine in has an additional 15% service Charges to be added additionally in the Invoice. 2- Click and Collect mode: No additional Charges for click and collect 3- Delivery mode: A fix charges for Delivery based on the distance i.e. More than 0 to 5 Kms AUD 5 More than 5 to 10 Kms AUD 10 More than 10 to 15 Kms AUD 18 More than 15Kms No Delivery provided B- Proceeding with the Order If the user decides to proceed with the order, the user is requested to insert further details based on their selected ordering mode as follows: For Dine in: • Number of Persons: • Date of Visit: DD/MM/YYYY • Time of Visit: HH:MM For Pick up: • Date of Pickup: DD/MM/YYYY • Time of Pickup: HH:MM • Name of Person Picking up: Delivery: • Date of Delivery: • Time of Delivery: • Distance from the Restaurant (In Kms): Notes: • If the distance from the restaurant is more than the applicable limits, then the user must be provided with the option to Pick up the Order. • Once the details have been successfully entered, user must be provided with a confirmation message. “Thank you for your Order, Your Order has been confirmed” • It must generate a unique order id in the format ‘S001’. • Then the user must be taken to the Main menu.

class Login: def __init__(self, loginid, password): self.loginid = loginid self.password = password def validate_login_id(self): if len(self.loginid) == 8 and self.loginid[0] == '0': return True else: return False def validate_password(self): if len(self.password) >= 8 and self.password[0].isalpha() and self.password[1] in ('@','&') and self.password.isnumeric(): return True else: return False class CustomerLogin(Login): def __init__(self, loginid, password, name, address, mobile): super().__init__(loginid, password) self.name = name self.address = address self.mobile = mobile def validate_details(self): if self.validate_login_id() and self.validate_password(): print('Welcome {}'.format(self

Questions about programming?Chat with your personal AI assistant