Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Practice 2 Program - Reading Files as a start. Modify the program to do the following: Request the data file name from the

image  imageimage

Use Practice 2 Program - Reading Files as a start. Modify the program to do the following: Request the data file name from the user. Use a try-except statement to detect errors when opening the file. Report any errors to the screen. Download the file sales error-1.txt to use as an input file. Use try-except to detect bad data in the input file. Report it to the screen and skip over bad values. Total and average the remaining good data and display results. Sample Output: This program will total and average numbers in your data file. Enter the name of your data file: sales Unable to access the file: sales. Process finished with exit code 0 This program will total and average numbers in your data file. Enter the name of your data file: sales_error-1.txt 13,420.22 45,229.32 35,223.22 29,302.20 95,893.21 94,721.94 Line 7 with a value of 84720.32 was invalid. 84,793.02 10,394.21 30,233.33 23,432.32 Total: Number of entries: Average: 462,642.99 10 46,264.30 Process finished with exit code 0 1 2 3 4 LO 5 a 7 8 9 10 11 12 13 sales_error-1.txt PROGRAMMING LOGIC PRG-105-001N Assignments Chapter 06 Assessment Program Logic - Files and Exc Download Info Close 13420.22 45229.32 35223.22 29302.20 95893.21 94721.94 84720.32 84793.02 10394.21 30233.33 23432.32 ZOOM +

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

What research interests does the faculty member have?

Answered: 1 week ago

Question

8.4 Identify common stages in the pathway to addiction.

Answered: 1 week ago