Question: What is the output of the following program? #include using namespace std; class Mountain { public: double get _ height ( ) const; Mountain (

What is the output of the following program?
#include
using namespace std;
class Mountain
{
public:
double get_height() const;
Mountain();
Mountain(double new_height);
private:
double height;
};
Mountain::Mountain()
{
height =0;
}
Mountain::Mountain(double new_height)
{
height = new_height;
}
double Mountain::get_height() const
{
return height;
}
int main()
{
Mountain cth1;
Mountain cth2(15000);
double total_height =0;
total_height = cth1.get_height()+ cth2.get_height();
cout << total_height << endl;
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!