Use Practice 2 Program - Reading Files as a start. Modify the program to do the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 + 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 +
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
This assignment requires you to complete the 2022 tax reporting for a fictional woman named Anna Smith. Question 1 T1 - step 4 - line 66 This is Anna's taxable income Answer: Question 2 T1 - step...
-
Why should one-time write-offs of fixed capital be used in absorption cost systems?
-
Assume that Sea Travel uses a periodic inventory system. (Refer to the data that precede Problem 8.2B.) Instructions a. Compute the cost of goods sold relating to the sale on April 28 and the ending...
-
A company has reported annual operating profits for the year of 89.2m after charging 9.6m for the full development costs of a new product that is expected to last for the current year and two further...
-
Determine whether each of the following is true or false. In each case, assume \(P\) is located at \(t=0\) and \(F\) is located at \(t=n\), and the \(A\) s are spread uniformly over the planning...
-
The Wickliffe City Council authorizes the restoration of the city library. The project is to be funded by the issuance of bonds, a reimbursement grant from the state, and property taxes. 1. Prepare...
-
3. Assume that the web-hosting service industry is pertectly competitive and that all web-hosting service providers are identical. Also assume that web-hosting services occur at datacenters that...
-
The interpolating polynomial p(r) of degree 4 of f(r) = 6x - 2r+ 9 is p(x) = 6z- 2z +9. Select one: O True False
-
Describe common methods for gathering data and evidence in health and science research. Since data and evidence can come from many different sources in science research, how do you determine if a...
-
What is the WACC for a company with market values of $4 million for debt and $1 million for preferred shares and $9 million for common stock. The cost of debt is 7%, the cost of preferred shares is...
-
I have a Speech On Texting Its a Persuasive Speech and Driving and I have to follow the Monroe Pattern Monroe's Motivated sequence pattern. Which is as follows I have to site 5 sources but need help...
-
simple Java program that takes and validates a date. The program must convert three integer numbers inputted by the user into a date of the 21st century. For example, if the user inputs 2, 2, and 22,...
-
Project - Locate information and present to a group of children and educators. For this project, you are to locate the following information (this can be at the service you work at or attend...
-
Show that a paraboloidal wave centered at the point P1 is converted by a lens of focal length f into a paraboloidal wave centered about P2, where 1/z1+1/z2=1/f. [hint: using U1, U2 and t] Pz P1 Z1
-
Review Exhibit 11.4. Analyze each product on the graph according to the characteristics that influence the rate of adoption. For example, what can you conclude from the data about the relative...
-
In 2012, Gale and Cathy Alexander hosted an exchange student, Axel Muller, for 9 months. Axel was part of International Student Exchange Programs (a qualified organization). Axel attended tenth grade...
-
Cypress Corporation has regular taxable income of $170,000 (assume annual gross receipts are greater than $5 million) and regular tax liability of $49,550 for 2012. The corporation also has tax...
-
Karim Depak received a Form 1099-B showing the following stock transactions and basis during 2012: None of the stock is qualified small business stock. Calculate Karim's net capital gain or loss...
-
What do you understand by a bank lending policy in the context of a monetary policy?
-
A columnist in the Wall Street Journal argues: Whether youre a borrower or a saver, what matters isnt the nominal interest rate but the real, post-inflation rate of return. Do you agree? Briefly...
-
What is the relationship between the MPC and the multiplier? Would a larger value for the MPC tend to increase or decrease the stability of the economy? Briefly explain.
The Oliver Wight Class A Standard For Business Excellence 7th Edition - ISBN: 1119404479 - Free Book
Study smarter with the SolutionInn App