Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions