Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Database Systems For Advanced Applications 15th International Conference Dasfaa 2010 Tsukuba Japan April 2010 Proceedings Part 1 Lncs 5981

Authors: Hiroyuki Kitagawa ,Yoshiharu Ishikawa ,Wenjie Li ,Chiemi Watanabe

2010th Edition

3642120253, 978-3642120251

More Books

Students also viewed these Databases questions