Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write the program in python Write a program that loops, prompting the user for their name, their year of birth, and the value of

Please write the program in python
image text in transcribed
Write a program that loops, prompting the user for their name, their year of birth, and the value of their vehicle, and then writes that data out to file called Customers,.txt: The program should check inputs for validity according to the following rules: First and last names must be alphabetic. No spaces or special characters. Names must be less than 20 characters long. Year of birth must be a four-digit number that starts with 19 or 20. It cannot be greater than the current year ( Value of the vehicle insured must be a positive floating point number in the range 0.00 to 1000000.0 inclusive The file should record each customers information on a single line and the output ile should have the following appearance. Nurke Fred 1958 24000 cranium Richard 1998 1500 Write a second program that opens the'Customers.txt file for reading and then reads each record, splitting it into its component fields and checking each field for validity. The rules for validity are as in your first program, with the addition of a rule that specifies that each record must contain exactly 4 fields. Your program should print out each valid record it reads. Your program should terminate when it reads an invalid record, printing out on which line number the error occurred, and what the error was

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_2

Step: 3

blur-text-image_3

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

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago