Question: l Reads information from a text file INTO a list of sublists. Be sure to ask the user to enter the file name and end
l
Reads information from a text file INTO a list of sublists. Be sure to ask the user to enter the file name and end the program if the file doesn't exist. Text file format will be as shown, where each item is separated by a comma and a space: ISBN, bookTitle, authorName, publicationDate, purchase Date Store the information into a list of sublists called booklist. bookList will be a list of sublists, where each sublist contains the information for one book. The pubDate and purchase Date in the file are strings, but should be stored as objects of type Date. Example of bookList with 2 books: [ ["1784876119","Gone with the Wind", "Margaret Mitchell", "06-30-1936","10-19-1999"}, ["978133859", "Harry Potter and the Sorcerer's Stone", "J.K. Rowling", "10-20-2020", "01-01-2021"] ] Print a report that shows the following: Book List ISBN Title Author PublicationDate Purchase Year YrsSincePub WRITE the following information out to a text file Be sure to ask the user what the text file should be named! Titles of Books published more than 25 years ago Titles of Books purchased in the last 5 years Last name of Author followed by the titles of books by that author Example input file: (entries separated by a comma and one space) 1111, Atonement, lan McEwan, 09-01-1980, 10-19-1999 2222, Ulysses, James Joyce, 01-01-2000, 01-02-2000 1784876119, Gone with the Wind, M. Mitchell, 06-30-1936, 10-19-1999 1111, Saturday, lan McEwan, 04-11-2006, 10-19-2020 Example report for the sample data: NOTE - use strftime for the output of the PubDate! Book List ISBN Title Author PubDate Purchase Year YrsSincePub 1111 Atonement lan McEwan Sept 1, 1980 1999 41 21 James Joyce M. Mitchell lan McEwan Jan 1, 2000 Jun 20, 1936 Apr 4, 2006 2000 1999 2020 85 15 2222 Ulysses 1784876119 Gone with the Wind 1111 Saturday . Example output file: Books published more than 25 years ago Atonement Gone with the Wind Titles of Books purchased in the last 5 years Saturday Author and Titles of Books by that author McEwan: Atonement, Saturday Joyce: Ulysses Mitchell: Gone with the Wind Reads information from a text file INTO a list of sublists. Be sure to ask the user to enter the file name and end the program if the file doesn't exist. Text file format will be as shown, where each item is separated by a comma and a space: ISBN, bookTitle, authorName, publicationDate, purchase Date Store the information into a list of sublists called booklist. bookList will be a list of sublists, where each sublist contains the information for one book. The pubDate and purchase Date in the file are strings, but should be stored as objects of type Date. Example of bookList with 2 books: [ ["1784876119","Gone with the Wind", "Margaret Mitchell", "06-30-1936","10-19-1999"}, ["978133859", "Harry Potter and the Sorcerer's Stone", "J.K. Rowling", "10-20-2020", "01-01-2021"] ] Print a report that shows the following: Book List ISBN Title Author PublicationDate Purchase Year YrsSincePub WRITE the following information out to a text file Be sure to ask the user what the text file should be named! Titles of Books published more than 25 years ago Titles of Books purchased in the last 5 years Last name of Author followed by the titles of books by that author Example input file: (entries separated by a comma and one space) 1111, Atonement, lan McEwan, 09-01-1980, 10-19-1999 2222, Ulysses, James Joyce, 01-01-2000, 01-02-2000 1784876119, Gone with the Wind, M. Mitchell, 06-30-1936, 10-19-1999 1111, Saturday, lan McEwan, 04-11-2006, 10-19-2020 Example report for the sample data: NOTE - use strftime for the output of the PubDate! Book List ISBN Title Author PubDate Purchase Year YrsSincePub 1111 Atonement lan McEwan Sept 1, 1980 1999 41 21 James Joyce M. Mitchell lan McEwan Jan 1, 2000 Jun 20, 1936 Apr 4, 2006 2000 1999 2020 85 15 2222 Ulysses 1784876119 Gone with the Wind 1111 Saturday . Example output file: Books published more than 25 years ago Atonement Gone with the Wind Titles of Books purchased in the last 5 years Saturday Author and Titles of Books by that author McEwan: Atonement, Saturday Joyce: Ulysses Mitchell: Gone with the Wind
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
