until now, we have not puts should follow a p fines and calls a text va

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
LAB ASSIGNMENTS
IMPORTANT: you should complete the PDP thinking process for each program.
1) text_validator.py - until now, we have not validated text
input. But some text inputs should follow a pattern. Write a
short program that defines and calls a text validation
function. Its purpose is to validate a full name or a book
title (pick one).
In your function definition, ask the user for input, then
use.split() on the string entered, to turn it into a list of
words. That way, you can use a loop to check each word,
and correct capitalization and spacing. Then, you will add
each corrected word back to a new string, and return.
Hint: Inside the loop, use conditional logic to determine the
right fix for each word. Parts of names should stay in lower
case, like van, der, de or di. In book titles, prepositions and
articles are lower case, UNLESS they are the first word.
Tricky!? Slides 15 & 17 of the lesson PPT may help.
You don't have to use the mipo_ex model. Instead, this
program has Main() and a function named Block(), plus
a function call & print statement, in main(), to show
the return value.
Welcome to the name validation program.
Please enter a full name for validation & correction. 8675309
Try again, and enter a full name:
Try again, and enter a full name: shanice van der sanden
The full name corrected is: Shanice van der Sanden
Welcome to the title validation program.
Please enter a title for validation & correction.
Try again, and enter a title: the best of the beatles
The corrected title is: The Best of the Beatles.
Transcribed Image Text:LAB ASSIGNMENTS IMPORTANT: you should complete the PDP thinking process for each program. 1) text_validator.py - until now, we have not validated text input. But some text inputs should follow a pattern. Write a short program that defines and calls a text validation function. Its purpose is to validate a full name or a book title (pick one). In your function definition, ask the user for input, then use.split() on the string entered, to turn it into a list of words. That way, you can use a loop to check each word, and correct capitalization and spacing. Then, you will add each corrected word back to a new string, and return. Hint: Inside the loop, use conditional logic to determine the right fix for each word. Parts of names should stay in lower case, like van, der, de or di. In book titles, prepositions and articles are lower case, UNLESS they are the first word. Tricky!? Slides 15 & 17 of the lesson PPT may help. You don't have to use the mipo_ex model. Instead, this program has Main() and a function named Block(), plus a function call & print statement, in main(), to show the return value. Welcome to the name validation program. Please enter a full name for validation & correction. 8675309 Try again, and enter a full name: Try again, and enter a full name: shanice van der sanden The full name corrected is: Shanice van der Sanden Welcome to the title validation program. Please enter a title for validation & correction. Try again, and enter a title: the best of the beatles The corrected title is: The Best of the Beatles.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Longest Common Subsequence
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education