Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (50 marks) Using C++, write a program to calculate the area and perimeter of four sinmple plane figures a agle, al, a square anda

image text in transcribed
1. (50 marks) Using C++, write a program to calculate the area and perimeter of four sinmple plane figures a agle, al, a square anda riangle. The program should begin by explaining itself to the user. It must then prompt the user for appropriate input (i.e: ask the user to select a rectangle, circle, square or triangle and then ask for necessary information based on the user's selection). Next, the program must calculate and output the perimeter and area of the appropriate figure and then ask the user if he or she would like to find the perimeter and area of another figure. We will assume all plane figures are measured in centimeters. The program MUST take advantage of the concepts of Inheritance and Polymorphism A base class must be defined (you can call it whatever you like, but better has a meaningful name, such as "PlaneFigure" might be a good choice). Other classes (for example, "Rectangle", "Circle", "Square" and "Triangle") must be derived from the "PlaneFigure" base class. Also, two methods must be defined for the "PlaneFigure" class: "perimeter" and "area These methods are to be overridden for each derived class. Your program should be well documented and easy to read

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are the purposes of collection messages? (Objective 5)

Answered: 1 week ago