Question: Write a class declaration for a class named Circle, which has the data member radius , a double , and member functions setRadius ( )

Write a class declaration for a class named Circle, which has the data member radius , a double , and member functions setRadius() which sets radius, calcArea() which returns the area of the circle, calcDiameter() which returns the diameter of the circle, calcCircumference() which returns the circumference of the circle, and getRadius() which returns the value of radius. The class should have a default constructor that has no parameters and sets radius to 1 and a second constructor which accepts a parameter of double named rad for the radius of the circle. Write the code for these as inline functions. Write a main() function that declares a Circle object and tests out ALL of the Circle class's functionality.
You are responsible for demonstrating all the functionality of your program based on the rubric for you to get credit. YOUR PROGRAM SHOULD DEMONSTRATE ALL OF THE FUNCTIONALITY WITHOUT ANY INPUT FROM THE USER! In industry you will be demonstrating that your program works like this. It is called a driver program. I should not have to interact with your program. Programs that are submitted without the use of a driver program will receive a grade of a 0 until they are corrected so that they operate with a driver program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!