Question: Need to write python programming for this structure. Do help with the solution. 4. a) Write a class definition for a Trapezium class. Variables The

 Need to write python programming for this structure. Do help with

Need to write python programming for this structure. Do help with the solution.

4. a) Write a class definition for a Trapezium class. Variables The Trapezium class should have variables for its base, top and height. Functions Write an init function that takes in 3 parameters and sets the base, top and height to these parameter values. In addition, the class should have a function that is capable of computing the area of a trapezium. Area of a trapezium = (base + top) * height/2 top ----- height base b) Write a Trapezium User python file to make use of the Trapezium class(which is created in the same TrapeziumUser python file). Your program should read in the Base, Top and Height and print out the area of trapezium. Note that you could read in the base with example code:base=float(input("Base:")) It would produce the following output assuming input values 4.5 for Base, 6 for Top and 5 for Height: Base: 4.5 Top:6 Height:5 26.25

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!