Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in Python that ask users for their last name, validate it (i.e., check it against business rules), and then display it as

Write a program in Python that ask users for their last name, validate it (i.e., check it against business rules), and then display it as confirmation with only the first letter capitalized, e.g., Smith. If the name is not valid per the business rules, the display should be an appropriate error message instead and the user should be prompted for an input until a valid input is obtained. Each of these two rules for last names as the business rules should be structured as a separate function: Names must be no longer than 20 characters but must be at least two characters. Names may have an apostrophe (e.g., ORourke) or a hyphen (e.g., Smith-Barnes) but no other punctuation, no spaces, and no numbers. For example, we dont allow Smith Jr. (has space and period) or Smith III (has space). The program should also display how many times each of the two rules was violated before a valid input was obtained.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

=+ Who will lead the negotiations?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago