Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Do in c++ cess/content/attachment/c4264829-95b8-4399-9b6b-b21157e68a91/Assignm kai.rutgers.edu: GForm W-7 (Rev. Sept 4-94. Express the mo G Google Laboratory 09: Chapter 9 Classes: A deeper look, Part 1

image text in transcribed
image text in transcribed
Do in c++
cess/content/attachment/c4264829-95b8-4399-9b6b-b21157e68a91/Assignm kai.rutgers.edu: GForm W-7 (Rev. Sept 4-94. Express the mo G Google Laboratory 09: Chapter 9 Classes: A deeper look, Part 1 Programming Methodologies Lab April 2, 2018 Problem Definition Create a class called Rectangle. This class stores only the Cartesian coordinates of the four coordinates of the rectangle. PI(3,3) P219,3) P43,0) P39.0 Use integer variables to represent the data of the class: the x and y coordinates of the four coners of the rectangle. Provide a constructor that enables an object of this class to be initialized when it is declared. The constructor should contain default comer values in case no initializers are provided Provide member functions that: Calculate the perimeter Calculate the area . . Calculate the width (Dimension along the horizontal line) Calculate the length (The larger of the two dimensions) Print the rectangle comers . The implementation of the class rectangle is divided in two steps: Part 1: Class Definition Implement the class definition for class Rectangle in a file called Rectangle.h. The class definition should contain only the prototypes of the member functions Rectangle, setCorners, getPerimenter, getArea, getwidth, getLength and printcorners. You can define more member functions if it is necessary. You also need to include the coordinates of the corners as integer data members. Determine if the functions and the data members should be private or public. You can find an example of the class definition for the class Time in the file Time.h - also available in Chapter 9.2 (page 379 of the Deitel book, ninth edition). Part 2.1: Member-function definition

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

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions