#include<iostream>

usingnamespacestd;

class Airplane

{   public:

voidset_altitude(doublenew_altitude);

        private:

        double altitude;

        //double speed;

};

 

 

int main()

{

Airplane myplane;

myplane.set_altitude(1000);

 

 

 

 

return 0;

}

 

void Airplane::set_altitude(doublenew_altitude)// :: scope resolution //setter, mutator

{

altitude = new_altitude;

return;

}

//Write a class for an airplane class with constructors, interface (mutators and accessors)

// and a test driver (main). It should be able to change altitude (up,down) and speed.

//The constructor will set the altitude to 0 and speed to zero and longitude and latitude

//to Boston, Massachusetts. The overloaded constructor will set longitude and latitude

//to some numbers. If the altutude ever falls below 0 the change altutude function should

//announce the plane had crashed and the program exit. Will be checked in class,

 

    • 12 years ago
    Solution
    NOT RATED

    Purchase the answer to view it

    • airplaneclass_cpp.cpp