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

What is the output of the following program?
#include using namespace std; class Car { public: double get_speed() const; Car(); Car(double dspeed); private: double speed; }; Car::Car(){ speed =0; } Car::Car(double dspeed){ speed = dspeed; } double Car::get_speed() const { return speed; } int main(){ Car c1; Car c2(5); double sum_speed =0; sum_speed = c1.get_speed()+ c2.get_speed(); cout << sum_speed << 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 Programming Questions!