Overall goal: Write a program in python that asks the user to input student data, verify that the data is valid, reform

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Overall goal: Write a program in python that asks the user to input student data, verify that the data is valid, reform

Post by answerhappygod »

Overall goal:Write a program in python that asks the user to input student data,verify that the data is valid, reformat the data if needed,storethe data in lists, and then eventually display all data back to theuser.Assignment:The program should ask for a W#, then a user’s full name, and thenthe phone number. Each should be stored in aseparate list. This means there will be three lists. After a userenters all data for one student, ask for the next set ofstudent information. (Note: In the future, this is not thepreferred way of storing the data, and the better way is tostoreeach person in one container, rather than each person spread acrossthree lists.)When the user has entered a q for the W#, stop, and then displayall student information on screen.Validate the W#, the name, and the phone number for properinput.The W# must be a 'W' followed by 8 digits. If not, continue to askthe user to enter a proper W#.The name must contain a first and last name. If not, continue toask the user for a proper name. A name can only haveletters a through z, it cannot have digits. The name can be enteredin two formats: 1) FirstName LastName or 2)LastName, FirstName. Within the list store the result in theFirstName LastName format. (Note: Various cultures andnaming systems don’t work with this scheme, but for thisassignment, keep it simple and assume there is at least adistinct first name and a distinct last name.)The phone number must consist of 10 digits. Strip out allunnecessary characters. Within the list store the number inthe format (XXX) XXX-XXXX.Sample run:A sample run of the program is as follows:Enter the student's W#: W01234567Enter the student's name: Bob SmithEnter the students phone number: 801-123-4567Enter the student's W#: W01925523Enter the student's name: Alice 1That name is not formatted correctly, please try again: AliceOneEnter the students phone number: 801-203-1910Enter the student's W#: 55556666
That W# is not correct, please try again: W55556666Enter the student's name: Sir Bartholomew “The King” BigglesworthIIIThat name is not formatted correctly, please try again: BartBigglesworthEnter the student's phone number: 1800IAMAWESOMEThat number is not correct, please try again: (801)9879870Enter the student's W#:That W# is not correct, please try again: W22222222Enter the student's name:That name is not formatted correctly, please try again: JillJohnsonEnter the student's phone number:That number is not correct, please try again: (801) 867-5309Enter the student's W#: W33334444Enter the student's name: Hernandez, OliviaEnter the student's phone number: (435) 234-2345Enter the students W#: qThe students are:W01234567 Bob Smith (801) 123-4567W01234567 Alice One (801) 203-1910W55556666 Bart Bigglesworth (801) 987-9870W22222222 Jill Johnson (801) 867-5309W33334444 Olivia Hernandez (435) 234-2345
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply