Solution Found!
Write a class declaration named Circle with a private member variable named radius
Chapter 13, Problem 43(choose chapter or problem)
Write a class declaration named Circle with a private member variable named radius. Write set and get functions to access the radius variable, and a function named getArea that returns the area of the circle. The area is calculated as 3.14159 * radius * radius
Questions & Answers
QUESTION:
Write a class declaration named Circle with a private member variable named radius. Write set and get functions to access the radius variable, and a function named getArea that returns the area of the circle. The area is calculated as 3.14159 * radius * radius
ANSWER:Step 1 of 3
C++ is an object-oriented language that is used in many applications. Class is the collection of related objects and methods. Methods can be called by the instantiation of objects from the main class. The class name must start with the upper case and the class will have access specifiers to have access control over the variables and methods. There are three types of access specifiers public, private, and protected.