Question: Create a Circle class with the class implementation in a file named Circle.cpp and the class declar tion in a file named Circle h (
Create a Circle class with the class implementation in a file named Circle.cpp and the class
declartion in a file named Circle h or Circle hpp with
private data member for a type double parameter: 'radius'
a default constructor which has no parameters
a parametrized constructor which takes in a single double parameter for 'radius'
accessor and mutator for 'radius' named getRadius and setRadius
member functions to return doubles for calculated parameters: area
diameter and circumferenceI
a member function dispCircle to display the values for a circle object
PI should be assumed to be exactly You may define this as a static
const double at the class scope, as a const double inside any method that uses it or
as a literal in the expression in which it's used.
A triangle is a closed shape bound within three lines. For an acute angled triangle, the base
and the height of the triangle are the important parameters, as seen in the following figure.
Area inside the triangle can be calculated using the formula:
base height
Create a Triangle class with the class implementation in a file named Triangle.cpp and the
class declaration in a file named Triangle.h or Triangle.hpp with
private data members for double parameters: 'base', 'height'
a default constructor which has no parameters
a parametrized constructor which takes in a double parameter for 'base' followed
by a double parameter for 'height'
accessors and mutators for 'base' named getBase dots and setBase and 'height'
named getHeight and setHeight
member function to return a double for calculated parameter: area
a member function dispTriangle to display the values for a triangle object
Create a Rectangle class with the class implementation in a file named Rectangle.cpp and
the class declaration in a file named Rectangle.h or Rectangle.hpp with
private data members for double parameters: 'length', 'width'
a default constructor which has no parameters
a parametrized constructor which takes in a double parameter for 'length' followed
by a double parameter for 'width'
accessors and mutators for 'length' named getLength and setL ength and
'width' named getWidth and setWidth
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
