swift homework

Write a Swift playground program for three classes – a ‘Quadrilateral’, a ‘Parallelogram’ and a ‘Rectangle’ class – such that:

  1. The ‘Quadrilateral’ is the base parent class and has four attributes for its four sides.
  2. The ‘Parallelogram’ extends the ‘Quadrilateral’ class where two sets of sides are parallel to each other.
  3. The ‘Rectangle’ extends the ‘Parallelogram’ where two adjacent sides are at right angles to each other.
  4. You will need to define attributes for side lengths and angles to appropriately create each type of object.
    1. Quadrilateral needs 4 sides and 1 angle
    2. Parallelogram needs 2 sides and 1 angle
    3. Rectangle needs 2 sides and 1 angle which is 90 degrees
    4. This site is helpful in figuring out how to construct the shapes – http://www.ambrsoft.com/TrigoCalc/Quadrilateral/Shape1.htm
  5. The sum of the four angles has to equal 360 degrees.
  6. You may also need computed properties for area, perimeter and diagonals.
  7. Demonstrate inheritance and polymorphism as applied to this set of classes. Assume any other properties or methods that may be useful to you in completing this assignment.
  8. Document your code, please.
  9. Also put comments in code where necessary to make it more descriptive
  10. Format your console output in a clear to understand manner.

Upload your playground and a screenshot of the console window.

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.