Question: Problem 1 Below is a template implementation of a class well. You should first implement the str_ member function for Well such that it returns

 Problem 1 Below is a template implementation of a class well.

Problem 1 Below is a template implementation of a class well. You should first implement the str_ member function for Well such that it returns a string formated to read: 'Well type: where will later be replaced with a string that indicates the well type in derived classes (see examples below). Next derive a class called Verticalwell from Well that has an attribute well_type = 'vertical' and takes a positional argument depth at instantiation and assigns it to an attribute called depth. Then implement a member function called compute_wellbore_volume that takes a positional argument diameter and using diameter and the attribute depth, computes the total volume of the wellbore. See the follow examples for the expected usage of the class and member functions. You should not reimplement the _str_function in Verticalwell. vertical_well = VerticalWell (depth = 5000) print(vertical_well) will return 'Well type: vertical' Also, vertical_well.depth will return 5000 and vertical_well.compute_wellbore_volume (diameter = 0.5) will return 981.7477042468104 I have imported the constant pi from the Python math module. You may use it in compute_wellbore_volume member functions. O]: from math import pi class Well(): def __init__(self): self.well_type = None

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!