Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is all one question and not very difficult, please have comments that explain the codes as I am facing issues with them. I will

This is all one question and not very difficult, please have comments that explain the codes as I am facing issues with them. I will definitely appreciate and thumbs up to your hard work if the codes work, you can be creative if you want with it as well. Thanks!

Please use C++ (I code in VS 2022) and use your object-oriented programming skills to write a well-structured, readable, and clean code that deals with shapes and operators (+ and *) based on the given requirements below. Mainly you have two shapes: Rectangle and Square. You should design both shapes so that you can do the following math: Rectangle r = r1 * 2 + r2; Where r1 and r2 of type Rectangle. The above equation is explained below.

image text in transcribed 1- Design, implement and test a Rectangle class which: a. Has a function to calculate its area. b. It can be printed using cout

2- Design, implement and test a Square class which: a. Has a function to calculate its area. b. It can be printed using cout

3- As stated at the beginning, you should design your Rectangle classes so that you can apply the following math: Rectangle r = r1 * 2 + r2; Where r1 and r2 of type Rectangle. r1 + r2 : results in a Rectangle with a length equal to the summation of both lengths and width equal to the summation of both widths. r*2 : results in a Rectangle with the length and the width scaled by 2. If the r Rectangle length = 4 and width = 2 then r*2 will result in a Rectangle with length = 8 and width = 4.

4- You should design your Square classes so that you can apply the following math: Square S = S1 * 2 + S2; Where S1 and S2 of type Square. S1 + S2 -> results in a square with a side length equal to the summation of both sides (s1 side and s2 sides). S*2 -> results in a square with side length scaled by 2. If the S square side length = 4 then S*2 will result in a square with a side length = 8.

2+=

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

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

More Books

Students also viewed these Databases questions

Question

Whatif anythingwould you say to your other students?

Answered: 1 week ago

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago