MATCH OUTPUT AS IT IS WITH QUESTION OUTPUT ---------------------------------------------------------------- Write a C++ program to find the perimeter of different shapes based on the inputs using abstract classes. Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. Consider a class named Shape with abstract method virtual double calculatePerimeter(). Consider a derived class named Circle derived from Shape with the following private member variables Data type Variable name double radius Include appropriate constructors, getters, and setters for the above class Consider a derived class named Rectangle derived from Shape with the following private member variables Data type Variable name double length double float Include appropriate constructors, getters, and setters for the above class Consider a derived class named Square derived from Shape with the following private member variables Data type Variable name double length Include appropriate constructors,getters and setters for the above class Implement the method calculatePerimeter() in all the derived classes to calculate appropriate perimeters. Note: Use 3.14 for pi value and display 2 digits after decimal in the answer. Input and Output format: Refer sample input and output for formatting specifications. [All Texts in bold corresponds to the input and the remaining corresponds to the output] Sample Input and Output 1: Select the shape: 1.Circle 2.Rectangle 3.Square 1 Enter the radius of the circle: 10 Perimeter of Circle is: 62.80 Sample Input and Output 2: Select the shape: 1.Circle 2.Rectangle 3.Square 2 Enter the length of the rectangle: 10.50 Enter the width of the rectangle: 11.50 Perimeter of Rectangle is: 44.00 Sample Input and Output 3: Select the shape: 1.Circle 2.Rectangle 3.Square 3 Enter the length of the square: 4.45 Perimeter of Square is: 17.80

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

MATCH OUTPUT AS IT IS WITH QUESTION OUTPUT

----------------------------------------------------------------

Write a C++ program to find the perimeter of different shapes based on the inputs using abstract classes.

Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.

Consider a class named Shape with abstract method virtual double calculatePerimeter().

Consider a derived class named Circle derived from Shape with the following private member variables

Data type Variable name
double radius

Include appropriate constructorsgetters, and setters for the above class

Consider a derived class named Rectangle derived from Shape with the following private member variables

Data type Variable name
double length
double float

Include appropriate constructorsgetters, and setters for the above class

Consider a derived class named Square derived from Shape with the following private member variables

Data type Variable name
double length

Include appropriate constructors,getters and setters for the above class

Implement the method calculatePerimeter() in all the derived classes to calculate appropriate perimeters.


Note: Use 3.14 for pi value and display 2 digits after decimal in the answer.

Input and Output format:
Refer sample input and output for formatting specifications.

[All Texts in bold corresponds to the input and the remaining corresponds to the output]
Sample Input and Output 1:
Select the shape:
1.Circle
2.Rectangle
3.Square
1
Enter the radius of the circle:
10
Perimeter of Circle is: 62.80

Sample Input and Output 2:
Select the shape:
1.Circle
2.Rectangle
3.Square
2
Enter the length of the rectangle:
10.50
Enter the width of the rectangle:
11.50
Perimeter of Rectangle is: 44.00

Sample Input and Output 3:
Select the shape:
1.Circle
2.Rectangle
3.Square
3
Enter the length of the square:
4.45
Perimeter of Square is: 17.80

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education