Program should be written in basic python. Focus on string operations and methods You work for a small company that keeps the following information about its clients: • first name • last name • a 5-digit user code assigned by your company. The information is stored in a file clients.txt with the information for each client on one line (last name first), with commas between the parts. For example Jones, Sally 00345 Lin ,Nenya,00548 Fule,A,00000 Smythe , Mary Ann , 00012 Your job is to create a program assign usernames for a login system. First: write a function named get_parts(string) that will that will receive as its arguments a string with the client data for one client, for example “Lin ,Nenya,00548”, and return the separate first name, last name, and client code. You should remove any extra whitespace from the beginning and newlines from the end of the parts. You’ll need to use some of the string methods that we covered in this lesson You can test your function by with a main() that is just the function call with the argument typed in. Second: write a function make_user(param) that will receive as its arguments three strings - the first name, last name, and client number and return the username. The user name should be created as • The first two characters of the first name, in lower case • The first two characters of the last name, in lower case • The last three characters of the user number For the example, the username for user Nenya Lin will be neli548 You’ll need to use slices, lower() and concatenation. You can test your function by with a main() that is just the function call with the arguments typed in. Finally: After your functions are working, write a main program to open the file, create usernames for the clients and print out client names and user names in a neat report format. For example, Client Username ======================= Sally Jones sajo345 Nenya Lin neli548 A Fule afu000 Mary Ann Smythe masm012

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 1DE
icon
Related questions
Question

Program should be written in basic python.

Focus on string operations and methods

You work for a small company that keeps the following information about its clients:

• first name • last name • a 5-digit user code assigned by your company. The information is stored in a file clients.txt with the information for each client on one line (last name first), with commas between the parts.

For example Jones, Sally 00345

Lin ,Nenya,00548

Fule,A,00000

Smythe , Mary Ann , 00012

Your job is to create a program assign usernames for a login system. First: write a function named get_parts(string) that will that will receive as its arguments a string with the client data for one client, for example “Lin ,Nenya,00548”, and return the separate first name, last name, and client code.

You should remove any extra whitespace from the beginning and newlines from the end of the parts. You’ll need to use some of the string methods that we covered in this lesson You can test your function by with a main() that is just the function call with the argument typed in.

Second: write a function make_user(param) that will receive as its arguments three strings - the first name, last name, and client number and return the username. The user name should be created as • The first two characters of the first name, in lower case • The first two characters of the last name, in lower case • The last three characters of the user number For the example, the username for user Nenya Lin will be neli548 You’ll need to use slices, lower() and concatenation. You can test your function by with a main() that is just the function call with the arguments typed in.

Finally: After your functions are working, write a main program to open the file, create usernames for the clients and print out client names and user names in a neat report format.

For example, Client Username =======================

Sally Jones sajo345

Nenya Lin neli548

A Fule afu000

Mary Ann Smythe masm012

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
ADT and Class
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT