Question: Write a python program that reads from a text file (whose name is provided by the user) dams data where each line contains the name

Write a python program that reads from a text file (whose name is provided by the user) dams data where each line contains the name of the dam, the rainfall amount and the dimension of the dam. Your program should compute the dam capacity and prints Flood if the rainfall amount exceeds the dam capacity where capacity= 10*dimension**2. Your program should consider the following erroneous cases and display appropriate message as shown in the sample output below:
The file does not open/exist
The rainfall and the dimension values are invalid (non-numeric)
The rainfall or dimension values are negatives, raise a ValueError "negative value", and the
processing should continue.
 Write a python program that reads from a text file (whose
name is provided by the user) dams data where each line contains

Ansab 100010 Tawyan 14008.5 Shams 10006d Sadaf -700 7 Tanuf 9008 Wadi Diqa 150020 AlKhodh 8509 Sample output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!