Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write pseudo code for the programming exercise described 2. 2.Create a class Rectangle , which stores only Cartesian coordinates of four corners of a

1. Write pseudo code for the programming exercise described 2.

2.Create a class Rectangle, which stores only Cartesian coordinates of four corners of a rectangle as arrays shown below:

p4[x4,y4] p3[x3,y3]

p1[x1,y1] p2[x2,y2]

The constructor calls a set function that accepts four sets of coordinates. The set function verifies that the supplied coordinates do, in fact, form a rectangle.

Provide member functions that calculate length, width, perimeter, and area. The length is larger of the two dimensions. Include a predicate function square that determines whether the rectangle is a square.

Write a program for the above described rectangle class, compile it, execute it, and demonstrate to your instructor.

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

More Books

Students also viewed these Databases questions