Create and save a file of the number below as module6data.txt: 26 O 76 -91 85 -44 85 -95 -34 83 -64 -76 -41 89 0 83 -99 -69 8 -79 0 -32 -49 -89 85 79 -28 56 19 -93 -21 -23 82 51 -80 l 62 -78 -8 71 28 -73 0 -45 -73 28 -5 O -70 63 -36 -72 0 -76 -24 -59 0 -54 83 35 -3 88 -14 29 -35 17 27 -61 -42 49 83 38 79 -80 33 8 41 96 -94 46 71 8 76 -63 -36 93 -82 -68 -20 69 -57 -84 -29 -17 77 36 -89 -94 62 10 -69 -43 Write a program in python that will  a. Open the file module6data.txt b. Create a second file named processed.txt c. Read the numbers from the first file one at a time. For each number write into the second file, if possible, its i. square  ii. square root. iii. reciprocal (1/number)  each on a separate line. • Use a math module function for the square root. • Use exception handling to trap possible errors. Error messages should be reported to the  screen. d. Report the number of items in the original file and the number that were successfully  stored in the second file. e. Report the number (count) of each type of error: ValueError, ZeroDivisionError,  TypeError

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter11: Exception Handling
Section: Chapter Questions
Problem 18RQ
icon
Related questions
Question

Focus on Basic file operations, exception handling
Create and save a file of the number below as module6data.txt:

26
O
76
-91
85
-44
85
-95
-34
83
-64
-76
-41
89
0
83
-99
-69
8
-79
0
-32
-49
-89
85
79
-28
56
19
-93
-21
-23
82
51
-80
l
62
-78
-8
71
28
-73
0
-45
-73
28
-5
O
-70
63
-36
-72
0
-76
-24
-59
0
-54
83
35
-3
88
-14
29
-35
17
27
-61
-42
49
83
38
79
-80
33
8
41
96
-94
46
71
8
76
-63
-36
93
-82
-68
-20
69
-57
-84
-29
-17
77
36
-89
-94
62
10
-69
-43
Write a program in python that will 
a. Open the file module6data.txt
b. Create a second file named processed.txt
c. Read the numbers from the first file one at a time. For each number write into the
second file, if possible, its
i. square 
ii. square root.
iii. reciprocal (1/number) 
each on a separate line.
• Use a math module function for the square root.
• Use exception handling to trap possible errors. Error messages should be reported to the 
screen.
d. Report the number of items in the original file and the number that were successfully 
stored in the second file.
e. Report the number (count) of each type of error: ValueError, ZeroDivisionError, 
TypeError

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Database connectivity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr