Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago