Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 408 Weeks Ago, 1 Day Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Management Posted 03 Feb 2018 My Price 9.00

Rectangle.cpp

CREATING A CLASS IN C++ In this lab, you create a programmer-defined class and then use it in a C++ program. The program should create two Rectangle objects and find their area and perimeter. Use the Circle class that you worked with in Exercise 10-1 as a guide.

 

1. Open the class file named Rectangle.cpp using Notepad or the text editor of your choice.

 

2. In the Rectangle class, create two private attributes named length and width. Both length and width should be data type double.

 

3. Write public set methods to set the values for length and width.

 

4. Write public get methods to retrieve the values for length and width.

 

5. Write a public calculateArea()method and a public calculatePerimeter() method to calculate and return the area of the rectangle and the perimeter of the rectangle.

 

6. Save this class file, Rectangle.cpp, in a directory of your choice and then open the file named MyRectangleClassProgram.cpp.

 

7. In the MyRectangleClassProgram, create two Rectangle objects named rectangleOne and rectangleTwo using the default constructor as you saw in MyEmployeeClassProgram.cpp.

 

8. Set the length of rectangleOne to 4.0 and the width to 6.0. Set the length of rectangleTwo to 9.0 and the width to 7.0.

 

9. Print the value of rectangleOne’s perimeter and area, and then print the value of rectangleTwo’s perimeter and area.

 

10. Save MyRectangleClassProgram.cpp in the same directory as Rectangle.cpp.

 

11. Compile the source code file MyRectangleClassProgram.cpp.

 

12. Execute the program.

 

13. Record the output below

 

 

 

 

 


Answers

(5)
Status NEW Posted 03 Feb 2018 09:02 PM My Price 9.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on-----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be-----------

Not Rated(0)