Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Create a C++ class named classA that will have 2 methods and two instance global variables as described below: The first instance global variable

3. Create a C++ class named classA that will have 2 methods and two instance global variables as described below: The first instance global variable (named radiusG) representing the radius of a circle. Its datatype is double. The second instance global variable (named strG), and its datatype is string. The 1st method is named funA that is an instance method and has one parameters (named ri) and a returned value. The data type of the parameters and the returned type is double. The method funA will calculate the area of a circle and return the area as the returned value. The radius of the circle is equal to the sum of radiusG and ri. The 2nd method is named funcB that is an instance method and has no parameters and has no returned value. The method increases the value of radiusG, i.e., ++radiumG, then uses the new value of radiusG as the radius to calculate the circumference of a circle, and finally prints the value of the circumference. In the main method of this class, create two instances of this class named (s1 and s2). The instance s1 will call funA and funB, and then print the value of 2 global variables. The instance s2 will call funA and then print the value of 2 global variables.

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