Question: #include Triangle.h #include Rectangle.h #include Pentagon.h #include using namespace std; Triangle resize ( Triangle t , int s ) { / /

#include "Triangle.h"
#include "Rectangle.h"
#include "Pentagon.h"
#include
using namespace std;
Triangle resize(Triangle t, int s){
// Placeholder Triangle. Replace the line below with
// an appropriate contructor call.
Triangle newTri;
/* Your code here */
return newTri;
}
Rectangle resize(Rectangle r, int s){
// Placeholder Rectangle. Replace the line below with
// an appropriate contructor call.
Rectangle newRect;
/* Your code here */
return newRect;
}
Pentagon resize(Pentagon p, int s){
// Placeholder Pentagon. Replace the line below with
// an appropriate contructor call.
Pentagon newPent;
/* Your code here */
return newPent;
}
int main(){
Triangle t = Triangle(1,2,3);
Rectangle r = Rectangle(5,6,5,6);
Pentagon p = Pentagon(3,4,5,6,7);
auto newTriangle = resize(t,3);
auto newRectangle = resize(r,2);
auto newPentagon = resize(p,10);
cout << "Resized Triangle Dimensions: ";
newTriangle.printTri();
cout << "Resized Rectangle Dimensions: ";
newRectangle.printRect();
cout << "Resized Pentagon Dimensions: ";
newPentagon.printPent();
return 0;
}

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 Programming Questions!