Question: Two doubles are read as the radius and the height of a Cone object. Assign pointer myCone with a new Cone object using the radius

Two doubles are read as the radius and the height of a Cone object. Assign pointer myCone with a new Cone object using the radius and the height as arguments in that order. #include
#include
using namespace std;
class Cone {
public:
Cone(double radiusValue, double heightValue);
void Print();
private:
double radius;
double height;
};
Cone::Cone(double radiusValue, double heightValue){
radius = radiusValue;
height = heightValue;
}
void Cone::Print(){
cout << "Cone's radius: "<< fixed << setprecision(1)<< radius << endl;
cout << "Cone's height: "<< fixed << setprecision(1)<< height << endl;
}
int main(){
Cone* myCone = nullptr;
double radiusValue;
double heightValue;
cin >> radiusValue;
cin >> heightValue;
/* Your code goes here */
myCone->Print();
return 0;
}

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!