Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

Explain the pages in white the expert taxes

Answered: 1 week ago

Question

=+g. Does it deliver one, instantly understandable message?

Answered: 1 week ago

Question

=+e. Does it entertain, inform and/or engage the reader?

Answered: 1 week ago

Question

=+h. Do all of the related materials project one cohesive message?

Answered: 1 week ago