Question
You are writing a program to collect data for the payment file. The data must be validated. Input: Name, Account Number and Payment Amount. Rules:
You are writing a program to collect data for the payment file. The data must be validated. Input: Name, Account Number and Payment Amount. Rules: Name cannot be blank Message: Name cannot be blank Must be at least 2 character long Message: Name to short Must be alphabetic Message: Name must be alphabetic Account number Cannot be blank Message: Account number cannot be blank Must be numeric (digits) Message: Account number must be numeric Must be 9 digits long Message: Account number must be 9 digits Payment amount Cannot be blank Message: Payment cannot be blank Cannot be negative Message: Payment cannot be negative Cannot be zero Message: Payment cannot be zero Issue error message if an error is detected for any of the inputs You as the programmer create the valid error messages Output: name with message, account number with message and payment with message Example output: (good) Name: John Smith valid Account Number: 123456789 Valid Payment: 10.74 valid (error) Name: John Smith valid Account Number: 12345 Invalid: Account number must be 9 digits Payment: 10.74 valid (error) Name: Invalid: Name cannot be blank Account number: 123456789 Valid Paymment: 0 Invalid: Payment cannot be zero. USE VALIDATION CONCEPT IN PYTHON
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started