Question: please write in Python3 ,thanks Given an input file, with a user-entered filename (e.g., Books.txt), where each line includes an ISBN, unit cost and the
Given an input file, with a user-entered filename (e.g., Books.txt), where each line includes an ISBN, unit cost and the number of copies of a book to be ordered, write a Python program to compute and print each book's ISBN, unit cost, number of copies to be ordered and the total cost of the book order. Also, at the end of the information about each book ordered, your program should compute and output the total cost of all books ordered. In addition, besides printing the required output, your program must also write the ISBN, number of copies ordered and the total cost of the book order to a new file called Yourrders.txt. Include exception handling in your program so that an error is produced and your program exits cleanly if the input file is not available. Call your program file Bookrders.py and test your program with the given file, Books.txt, as shown below. Test your program and submit your files including your input file and the file Yourorders.txt created by your program. Note: The input file should be placed in the same directory as the py file for testing (or the pathname to the input file would need to be specified) For example, with the given input file Books.txt as follows: 9786374386139,19.49,5 9781451673265,21 29.8 978088735e773,15.99,2 97885448e3415,35.99,3 978066238500, 30.90,6 9788545162274,52.65,8 9780 375386130,29.49,10 9781801673293,41.29,8 9788117358799,18.99,4 9783654003415,18.99,6 9782667238543,20.se,5 9781431620722,32.99,2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
