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::endl; std::cout << rec.get_name() << std::endl; rec.set_name("Eeeeeeee"); std::cout << rec.get_name() << std::endl; } { square squ("Squareeeee", 10.255); std::cout << squ.get_name() << std::endl; squ.set_name("AAAaaaa"); std::cout << squ.get_name() << std::endl; std::cout << squ.area() << std::endl; } }

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

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::endl;
std::cout << rec.get_name() << std::endl;
rec.set_name("Eeeeeeee");
std::cout << rec.get_name() << std::endl;
}

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

<<abstract>>
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
Transcribed Image Text:<<abstract>> 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
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Data members
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT