Reference no: EM131397395
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
Perform the paired t test for means
: For the data in Table, perform the paired T test for means using the weights for the east and south sides of the trees. Verify that the p-value is 0.09.
|
Future human resources needs of an organization
: When an HR Department is planning for the future Human Resources needs of an organization, it is also involved in an Internal Assessment of its current workforce. What is the purpose of this activity – Describe briefly
|
Managing human resources
: The aim of this assignment is to assess understanding of the theory and practice of human resource management focussing on current human resources practice and the impact of topical issues and legislation.
|
Vectors in an n-dimensional vector space
: Let {x1,x2,...,xn} be any set of n vectors in an n-dimensional vector space V. Prove that V=span{x1,x2,...,xn} if and only if {x1,x2,...,xn} is linearly independent.
|
Write public set methods to set values for length and width
: 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.
|
Current evidence and implications for future research
: NURS 141: Article is Evidence Based, peer reviewed, published
|
More full-time employee to meet additional demand
: Dave's Stove-Top Popcorn currently has three full-time employees who are each paid $1,300 per month. An employee can only work a maximum of 100 hours per month because production normally takes place at night. Develop a production plan if Dave relies..
|
System of two equations in two variables
: Express the situation as a system of two equations in two variables. Be sure to state clearly the meaning of yourx- andy-variables. Solve the system by row-reducing the corresponding augmented matrix. State your final answer in terms of the origin..
|
Perform the paired t test for means using the weights
: For the data in given Table, perform the paired T test for means using the weights for the east and south sides of the trees. Verify that the p-value is 0.09.
|