Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Question Note: DO NOT USE VECTORS Develop and write a class that represents a rectangle . You are going to need to determine a

C++ Question

Note: DO NOT USE VECTORS

Develop and write a class that represents a rectangle. You are going to need to determine a rectangle's length, height and area. This should be a well formed class with appropriate interfaces and access control. You will only need two member variables. For this particular application, set methods for length and height are appropriate.

Your rectangle should have a method to *print both the parameters, but also a graphical representation of the rectangle.

As an example for a rectangle that is h: 3 x L: 5:

 ***** * * ***** Height: 3, Length: 5, Area: 15

Once made a rectangle cannot be copied. Place a single cout statement in the constructor of your rectangle. Every time a rectangle is created the constructor will output to the screen. This should only happen 10 times total for your whole piece of code.

Create an array of 10 rectangles. After creating this array, assign each rectangle a random height and length, each between 1 and 15. This should be a for loop that uses the rectangle's set interfaces.

Write four functions that interact with your array of rectangles:

  • One function that finds the area of all of the rectangles in the array.
  • One function that finds the longest rectangle and calls its print method. Deal with ties appropriately.
  • One function that finds the tallest rectangle and calls its print method. Deal with ties appropriately.
  • One function that finds the rectangle with the largest area and calls its print method. Deal with ties appropriately.

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

What events play to their strengths?

Answered: 1 week ago

Question

a. Do team members trust each other?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago