Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment

Implement the following class hierarchy inside of a module file called polygon.py.

Polygon

Triangle Quadrilateral Pentagon Hexagon Octagon

Isosceles Tri Equilateral Tri Rectangle

Square

Each class should be able to calculate the area and perimeter for an object of that class.

Write another "driver" script called project1.py which imports the polygon.py module, reads an input file of polygonal data and writes another file of areas and perimeters.

Additional notes

All data members should be private and accessed through getters and setters.

Assume that the pentagons, hexagons and octagons are regular.

Assume that the quadrilaterals are cylic.

Do not use the regular polygon area formula for anything but pentagons, hexagons and octagons.

Do not use Brahmagupta's formula for anything but the cyclic quadrilaterals.

Regular polygon constructors should take a single argument for their side length.

The isosceles triangle constructor should take a base and a height.

Other irregular polygon constructors should take an argument for each side.

You should check for nonsensical input, at the very least, check for positive entries.

To open files for reading and writing, review the open function.

To parse the strings in the input file, look at string methods like split.

To read command line arguments, look at the standard sys module and argv.

To write a set number of decimal places, use the string method format.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92027726
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question suppose your il license encodes your name sex and

Question : Suppose your IL license encodes your name, sex, and birthday month/year which can be used by police officers and bouncers to determine if you are who your license says you are. What kind of encoding would this ...

What are information silos what are the problems caused by

What are information silos? What are the problems caused by information silos? How organizations can solve the problems caused by information silos?

Take the input of numbers and reverse the order of elements

Take the input of numbers and reverse the order of elements in that vector using recursion.

Question what is the relationship between programming and

Question : What is the relationship between programming and networking, and do you think that the United States has lost some of its economic advantage in these fields to other parts of the world?

Suppose there is exactly one packet switch between a

Suppose there is exactly one packet switch between a sending host and a receiving host. The transmission rates between the sending host and the switch and between the switch and receiving host are R1 and R2 respectively. ...

Question suppose we perform a sequence of n operations on a

Question : Suppose we perform a sequence of n operations on a data structure in which teh ith operation costs i 2 of i is an exact power of 2 and 1 otherwise. Use aggregrate analasys and accounting method to determine th ...

Question suppose that a bayesian spam filter is trained on

Question : Suppose that a Bayesian spam filter is trained on a set of 10000 spam messages and 5000 messages that are not spam. The word "opportunity" appears in 175 spam messages and 20 messages that are not spam. Would ...

Solve the water-jug puzzle given a 3-litter jug named three

Solve the water-jug puzzle given a 3-litter jug, named Three, and a 4-liter jug, named Four. Initially, Three and Four are empty. Either jug can be filled with water from a tap T, and one can discard water from either ju ...

Suppose users share a 2 mbps link also suppose each user

Suppose users share a 2 Mbps link. Also suppose each user transmits continuously at 1 Mbps when transmitting, but each user transmits only 20 percent of the time. When a circuit switching is used, how many users can be s ...

Inverse elasticityimagine youve started a new pizza

Inverse Elasticity: Imagine you've started a new pizza restaurant. It costs you about $3 to produce a pizza. Last week you sold 450 pizzas for $12 each. This week you raised your price and sold 300 pizzas for $16 each. W ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As