Question: Write a class named Helicopter that has the following member variables: year - An variable that holds the aircraft's model year. make - A string

Write a class named Helicopter that has the following member variables:
year - An variable that holds the aircraft's model year.
make - A string object that holds the make of the aircraft
owner- A string object that holds the type of owner of the aircraft.
speed - An int data type that holds the aircraft's current speed.
altitude- An int data type that holds the aircraft's current altitude.
latitude location - An int data type that holds the aircraft's current latitude position.
longitude location - An int data type that holds the aircraft's current longitude position.
In addition, the class should have the following member functions.
Constructor - The constructor should accept the aircraft's owner and make arguments and assign these values to the objects owner and make member variables. The constructor should initialize the speed variable to 0 and the altitude variable to 0.
Accessors - Appropriate accessor functions should be created to allow values to be retrieved from an objects year, make, owner, altitude, and speed member variables.
Mutator - Appropriate mutator function should be created to allow the value to be set of the objects year, make, owner, altitude, and speed member variables.
accelerate -The accelerate function should add 100 to the speed member variable each time it is called
.
decelerate- The decelerate function should subtract 100 from the speed member variable each time it is called
ascend - The ascend function should add 100 to the altitude member variable each time it is called
descend - the descend function should subtract 100 from the altitude member variable each time it is called
.
toString - The toString function should return the entire state of the aircraft class using labels to identify the data values of the data members of the object
Demonstrate the class in a program that creates a Helicopter object and then calls the accelerate function five times. After each call to the accelerate function, get the current speed of the aircraft and display it. Then, call the brake function five times. After each call to the brake function, get the current speed of the car and display it.
After testing the accelerate and brake functions, call the function to change the engine type and pass it a value for a different engine. display the state of the Aircraft using the toString function
Students may use any development environment of their choice. However, I will not be able to support the variety of possible development environments on my side. Many of the alternate Integrated Development Environments (IDEs) may require additional folders and files to execute the project. My only requirement for the C++ programs submitted for this course will be that the code is combined into a single C++ source file that can be compiled and executed with a standard C++ compiler.

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!