Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
100%

Please follow the instructions given in the images below, and give us a sample of what the output will look like, thank you.

[画像:CIS 023 - Lab2 Mockups ONLINE Exercise L2-1 Chap 13 Overloading and Templates Please ensure your class header files have the exact same function names as listed below. If your class definitions do not match, I will be unable to test them. When submitting your lab assignment submit only the .cpp and .h files you created or modified. Be sure you have coded the cout statement as described in the Grading Rubric inside the contructor. In this exercise, first redefine the class rectangle Type by declaring the instance variable as protected and then overload additional operators as defined in parts A through C. A. Overload the pre- and post-increment and decrement operators to increment and decrement, respectively, the length and width of a rectangle by one unit. (Note that after decrementing the length and width, they must be positive.) B. Overload the binary operator - to subtract the dimensions of one rectangle from the corresponding dimensions of another rectangle. If the resulting dimensions are not positive, output an appropriate message and do not perform the operation. C. The operators == and != are overloaded by considering the lengths and widths of rectangles. Redefine the functions to overload the relational operator by considering the areas of rectangles as follows: two rectangles are the same, if they have the same area; otherwise, the rectangles are not the same. Similarly, rectangle yard1 is greater than rectangle yard2 if the area of yard1 is greater than the area of yard2. Overload the remaining relational operators using similar definitions. D. Write the definitions of the functions to overload the operators defined in parts A through C. E. Write a test program that tests various operations on the class rectangleType. rectangleType.h double area() const; double getLength() const; double getWidth() const; double perimeter() const; void setDimension(double I, double w); friend ostream& operator<<(ostream&, const rectangle Type &); friend istream& operator>>(istream&, rectangle Type &); G:\CIS 23 - Data Structures and Algorithms2020円 Sprg\CIS023-Mockups Spring 2020\CIS 023 - Lab2 Mockups ONLINE.docx]
expand button
Transcribed Image Text:CIS 023 - Lab2 Mockups ONLINE Exercise L2-1 Chap 13 Overloading and Templates Please ensure your class header files have the exact same function names as listed below. If your class definitions do not match, I will be unable to test them. When submitting your lab assignment submit only the .cpp and .h files you created or modified. Be sure you have coded the cout statement as described in the Grading Rubric inside the contructor. In this exercise, first redefine the class rectangle Type by declaring the instance variable as protected and then overload additional operators as defined in parts A through C. A. Overload the pre- and post-increment and decrement operators to increment and decrement, respectively, the length and width of a rectangle by one unit. (Note that after decrementing the length and width, they must be positive.) B. Overload the binary operator - to subtract the dimensions of one rectangle from the corresponding dimensions of another rectangle. If the resulting dimensions are not positive, output an appropriate message and do not perform the operation. C. The operators == and != are overloaded by considering the lengths and widths of rectangles. Redefine the functions to overload the relational operator by considering the areas of rectangles as follows: two rectangles are the same, if they have the same area; otherwise, the rectangles are not the same. Similarly, rectangle yard1 is greater than rectangle yard2 if the area of yard1 is greater than the area of yard2. Overload the remaining relational operators using similar definitions. D. Write the definitions of the functions to overload the operators defined in parts A through C. E. Write a test program that tests various operations on the class rectangleType. rectangleType.h double area() const; double getLength() const; double getWidth() const; double perimeter() const; void setDimension(double I, double w); friend ostream& operator<<(ostream&, const rectangle Type &); friend istream& operator>>(istream&, rectangle Type &); G:\CIS 23 - Data Structures and Algorithms2020円 Sprg\CIS023-Mockups Spring 2020\CIS 023 - Lab2 Mockups ONLINE.docx
[画像:CIS 023 - Lab2 Mockups ONLINE rectangle Type operator + (const rectangle Type &) const; rectangle Type operator - (const rectangle Type &) const; rectangle Type operator* (const rectangle Type&) const; rectangle Type operator ++ (): rectangle Type operator ++ (int); rectangle Type operator -- (): rectangle Type operator -- (int); bool operator == (const rectangle Type&) const; bool operator != (const rectangle Type&) const; bool operator <= (const rectangleType&) const; bool operator < (const rectangle Type&) const; bool operator >= (const rectangleType&) const; bool operator > (const rectangleType&) const; rectangle Type(); rectangle Type(double I, double w); G:\CIS 23 - Data Structures and Algorithms 2020 Sprg\CISO23-Mockups Spring 2020\CIS 023-Lab2 Mockups ONLINE.docx]
expand button
Transcribed Image Text:CIS 023 - Lab2 Mockups ONLINE rectangle Type operator + (const rectangle Type &) const; rectangle Type operator - (const rectangle Type &) const; rectangle Type operator* (const rectangle Type&) const; rectangle Type operator ++ (): rectangle Type operator ++ (int); rectangle Type operator -- (): rectangle Type operator -- (int); bool operator == (const rectangle Type&) const; bool operator != (const rectangle Type&) const; bool operator <= (const rectangleType&) const; bool operator < (const rectangle Type&) const; bool operator >= (const rectangleType&) const; bool operator > (const rectangleType&) const; rectangle Type(); rectangle Type(double I, double w); G:\CIS 23 - Data Structures and Algorithms 2020 Sprg\CISO23-Mockups Spring 2020\CIS 023-Lab2 Mockups ONLINE.docx
Expert Solution
Check Mark
Step 1

The solution is given below

Still need help?
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Hey thank you for your answer.

I would like to know the main C++ modules that I need to know/understand to complete this program myself. i.e (Classes, structures, arrays, strings...)

Please let me know the exact modules so I can study them as soon as possible.

Thank you.

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Hey thank you for your answer.

I would like to know the main C++ modules that I need to know/understand to complete this program myself. i.e (Classes, structures, arrays, strings...)

Please let me know the exact modules so I can study them as soon as possible.

Thank you.

Solution
Bartleby Expert
by Bartleby Expert
SEE SOLUTION
Knowledge Booster
Background pattern image
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
    Recommended textbooks for you
    Text book image
    Database System Concepts
    Computer Science
    ISBN:9780078022159
    Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
    Publisher:McGraw-Hill Education
    Text book image
    Starting Out with Python (4th Edition)
    Computer Science
    ISBN:9780134444321
    Author:Tony Gaddis
    Publisher:PEARSON
    Text book image
    Digital Fundamentals (11th Edition)
    Computer Science
    ISBN:9780132737968
    Author:Thomas L. Floyd
    Publisher:PEARSON
    Text book image
    C How to Program (8th Edition)
    Computer Science
    ISBN:9780133976892
    Author:Paul J. Deitel, Harvey Deitel
    Publisher:PEARSON
    Text book image
    Database Systems: Design, Implementation, & Manag...
    Computer Science
    ISBN:9781337627900
    Author:Carlos Coronel, Steven Morris
    Publisher:Cengage Learning
    Text book image
    Programmable Logic Controllers
    Computer Science
    ISBN:9780073373843
    Author:Frank D. Petruzella
    Publisher:McGraw-Hill Education