Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a small program to simulate a helicopter flying; the class Flying has the methods API, enter_date, fly_helicopter: Method API calls the method enter_data

C++

Write a small program to simulate a helicopter flying; the class Flying has the methods API, enter_date, fly_helicopter:

Method API calls the method enter_data

Method enter_data asks the user how many helicopters are flying, to create an array of struct HelicopterData helicopter; helicopter containing the variables fuel and visibility; Method enter_data also asks for the fuel and what is the current visibility for each helicopter; then enter_data returns the array of helicopter to the method API;

Method API calls the method fly_helicopter, sending the array of helicopter to fly_helicopter;

Inside fly_helicopter, check for each helicopter: if the visibility is smaller than 60% don't fly and print the message "not safe to fly"; otherwise keep flying until the fuel is larger than 10%; every loop subtract 2% from the fuel and print the message, e.g.:"flying... now with fuel 30%" showing the value of the variable fuel; when fuel gets smaller than 10% print the message "low fuel 9% landing now" and finish the program.

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions

Question

Differentiate between hard and soft measures of service quality.

Answered: 1 week ago

Question

Be familiar with the different perspectives of service quality.

Answered: 1 week ago