Question: Primarily using DEV C + + application for C + + coding Question is below the coding. #include using namespace std; / / Function to

Primarily using DEV C++ application for C++ coding
Question is below the coding.
#include
using namespace std;
// Function to calculate area of rectangle
void rectangleArea(int L,int B)
{
float area=L*B;
cout<<"Area of rectangle: "<>shape;
// If shape is R, then call rectangleArea() function
if(shape=="R")
{
rectangleArea(parameter1,parameter2);
}
// If shapeis equal to T, then call triangleArea() function
else if(shape=="T")
{
triangleArea(parameter1,parameter2);
}
// Else print Invalid message
else
{
cout<<"Invalid choice.";
}
}while(shape!="T" && shape!="R");
// Repeat the loop until vilate the while condition
return 0;
}
C. Implement the above problem with Object-oriented design. [11mark]
- Implement a class Shapes
- Implement member functions to accept inputs
- Implement suitable methods to implement the calculations for the area.
- The output should be same as above.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!