Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use python3 to write :The management of a municipal library decided to implement

ID: 3878641 • Letter: U

Question

Use python3 to write :The management of a municipal library decided to implement a new policy regarding penalties for those members that do not return books on time.

Indeed, management has noticed that some members have not returned books for a very long time. While there is a penalty of 25 cents per day of the late return of a book, the new policy requires that the members pay the full cost of the book after more than 90-day delay in addition to the typical penalty. Assume you were asked to help by writing a simple python program that read files and produces other files with very specific formats.

The database team of the library provides you with two text files containing a snippet of their data related to this particular group.

The first filemembers.txtcontains the list of library members known to have due books. The file has their phone number and the city their address. The file has in each line a phone number, a full name and an address separated by ",”. The file content looks like this:

The second file books.txt, contains information about the books not yet returned. Each line contains the code identifying the book, its value, the date it was expected to be returned, and the phone number of the member who borrowed it, all separated by ";”. The date is formated YYYY/MM/DD. The file looks like this.

You are required to write a program that would generate a file, call it summary.txt, that can be printed and contains a table listing the culprit members with their total dues and the list of the books they needed to return. The table should be formatted as follows and the list of books should be outside the table on the right. The list of books should be formatted with the book code between square brackets followed by the number of days due between parenthesis. Your program should read the two files and produce a table formatted as follows:

The table has 3 columns and is sorted by the phone number.

The first column is the phone number. This number has to be formatted as (999) 999 9999.

The second column is the name and it has to be 30 characters wide.

The third column is the amount due. This amount should be printed with 7 positions and only 2 after the decimal point. Note that the penalty is $0.25 per late day plus the full cost of the book if the delay if more than 90 days.

Moreover, alongside the table and on the same row of the member, we need to have the list of books and the number of days missing formatted as described.

Finally, a line at the end of the table should indicate the total amount due by the whole group. The table should be formatted as illustrated above.

In addition the output file, the same output should also appear on the screen.

Explanation / Answer

main.py

========================================================================