Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 7: Name your program Lab13_ex7_Id.py Write a python program that reads from a text file (whose name is provided by the user) dams' data
Exercise 7: Name your program Lab13_ex7_Id.py 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. Ansab 100010 Tawyan 14008.5 Shams 10006d Sadaf - 7007 Tanuf 9008 Wadi Diqa 150020 AlKhodh 8509 Sample input file Sample output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started