using c++ oop !!! kindly need help asap. Implement the shape, rectangle, and square classes with components as shown and the following functionality: Each constructor and destructor prints a message...


using c++ oop !!! kindly need help asap.



Implement the shape, rectangle, and square classes with components as shown and the following functionality:



  • Each constructor and destructor prints a message to the screen that it is being called

  • in each class implement the area() method that calculates the area of the figure (for the Shape class you can return 0)



Example


Constructor shape: Rectanleeeeeee Rectangle constructor 232.5 Rectanleeeeeee Eeeeeeee Rectangle destructor Shape destructor Constructor shape: Squareeeee Rectangle constructor Square constructor Squareeeee AAAaaaa 105.165 Square destructor Rectangle destructor Shape destructor



// main.cpp : Defines the entry point for the application.
//


#include "main.h"
using namespace std;


int main(void) {
{
rectangle rec("Rectanleeeeeee", 10, 23.25);
std::cout < rec.area()=""><>
std::cout < rec.get_name()=""><>
rec.set_name("Eeeeeeee");
std::cout < rec.get_name()=""><>
}


{
square squ("Squareeeee", 10.255);
std::cout < squ.get_name()=""><>
squ.set_name("AAAaaaa");
std::cout < squ.get_name()=""><>
std::cout < squ.area()=""><>
}
}


<<abstract>><br>shape<br>+shape(name: sting)<br>+-shape()<br>+setName(name: string)<br>+getName() string<br>+ areal): double -0<br>#name: string<br>rectangle<br>+rectangle(name:string, width: double, height:double)<br>+-rectangle()<br>+area() double<br>#width:double<br>#height: double<br>square<br>+square(name:string, width: double)<br>+-square()<br>+areal): double<br>CREAT ED WITH YUML<br>

Extracted text: > shape +shape(name: sting) +-shape() +setName(name: string) +getName() string + areal): double -0 #name: string rectangle +rectangle(name:string, width: double, height:double) +-rectangle() +area() double #width:double #height: double square +square(name:string, width: double) +-square() +areal): double CREAT ED WITH YUML
Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here