how do i code this in python Your program should be able to process any of the three transactions each time it runs. (You need to include appropriate input operations to get data from the user, however, due to the nature of this problem, you should not include any user prompt text as part of your input.) Because we have yet to do looping, your program does not need to process more than one transaction at a time. However, your program must recognize the transaction that is being requested and process accordingly. Before doing any transaction processing, your program should do the following error checking on the provided data: testing for valid customer number (does the customer number exist on the company's customer list?) is the transaction type valid? This is the only error checking you need to do -- you may assume all other data provided will be valid If the data is invalid, you should print one or both of the following messages: Customer number ##### is invalid. Transaction type XX is invalid. After reporting one or both of these error messages, you should not do any further processing. If both the customer number and transaction type are valid, you should continue processing based on the transaction type as described below: Customer Name Change From the customer name change transaction data provided, construct a revised name in the format Last Name, First Name Middle (ex: Johnson, Jimmy James) update the appropriate customer name print the customer_name list (entire list, not individual item) Customer Password Change Evaluate the new password to see if it is secure according to the following rules: At least 6 characters in length (not counting spaces) Having the first four characters as follows: first character an upper case letter second character a lower case letter third character a number fourth character one of the following: !@#$%^&*() (you do not need to check after the fourth character) If the new password is not secure: print the following message: New password not secure. Request denied. (No further processing is necessary) If the new password is secure, update the password in the customer data print the customer_password list (entire list, not individual item)
how do i code this in python
Your
Before doing any transaction processing, your program should do the following error checking on the provided data:
- testing for valid customer number (does the customer number exist on the company's customer list?)
- is the transaction type valid? This is the only error checking you need to do -- you may assume all other data provided will be valid
If the data is invalid, you should print one or both of the following messages:
- Customer number ##### is invalid.
- Transaction type XX is invalid.
After reporting one or both of these error messages, you should not do any further processing.
If both the customer number and transaction type are valid, you should continue processing based on the transaction type as described below:
Customer Name Change
From the customer name change transaction data provided,
- construct a revised name in the format Last Name, First Name Middle (ex: Johnson, Jimmy James)
- update the appropriate customer name
- print the customer_name list (entire list, not individual item)
Customer Password Change
Evaluate the new password to see if it is secure according to the following rules:
- At least 6 characters in length (not counting spaces)
- Having the first four characters as follows:
- first character an upper case letter
- second character a lower case letter
- third character a number
- fourth character one of the following: !@#$%^&*()
- (you do not need to check after the fourth character)
If the new password is not secure:
- print the following message:
- New password not secure. Request denied.
- (No further processing is necessary)
If the new password is secure,
- update the password in the customer data
- print the customer_password list (entire list, not individual item)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images