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 rectangle Type.
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 rectangle Type.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
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.
Expert Solution
Step 1
The solution is given below
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
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
Please let me know the exact modules so I can study them as soon as possible.
Thank you.
Solution
by Bartleby Expert
Knowledge Booster
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.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education