Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions

Question

Describe the three major components of prejudice.

Answered: 1 week ago

Question

u = 5 j , v = 6 i Find the angle between the vectors.

Answered: 1 week ago