Problem

This assignment implements a hypothetical troubleshooting tree for possible engine failure in light aircraft. DO NOT FOLLOW IN A REAL EMERGENCY! A decision tree is an Artificial Intelligence method for arriving at a decision based upon a collection of IF state- ments. The computer asks a question and responds, based upon the answers. The computer only asks the relevant question based upon the user's answers (ie you dont ask all the questions and then try to sort it out.)

Requirements

This program is menu driven. It presents four menu options, repre- senting 3 potential emergency situations: Communications Failure, Engine Failure, In-flight Icing. Quit the program is the final menu option. See figure 1 for an example menu.

1. Communications Failure

  • This option only leads to 1 element, "Switch to Alternate Radio."

2. Engine Failure

  • This activates the decision tree. This is basically a collection of IF statements arranged in a hierarchy. This is shown on the diagram below.

3. In-Flight Icing

  • Prompt the pilot for the estimated amount of ice on the wings (0 mm to 10 mm). Aircraft will not fly with more than 10 mm of ice (and pilots will not be operating this system).
  • Range check this to make sure only 0 mm to 10 mm can be entered.
  • The amount of ice determines how much power to use to ener- gize the deicing boots on the wings.
    • Less then 1mm, 5% power
    • 1 - 5 mm, 20% power
    • 5.1 - 9 mm, 65% power
    • 9.1 - 10 mm, 100% power
  • Only ask questions relevant to the situation and previous answers. Do not ask for all the inputs at once, nor dump all the output at once (too stressful for the pilot!).
  • Display the results of all computations.
  • Make your program output as easy to read as possible.
  • Program activities are split into logical 'chunks or paragraphs.
  • No global variables or global variable look a-likes.
  • Use white-space and comments to make your code more readable.
  • Put a Source File Header at the top of your source file.
  • Include a void ProgramGreeting() function. This will run auto- matically once when the program first starts. This function should display (on individual lines):
    • A welcome message.
    • Your name (as author).
    • The date this assignment is due. Format this as MonthName day, year. Example: June 30, 1988.
  • Do not your c (.h) style libraries. Use c++ libraries instead.
  • Your program must compile in C++ on Ubuntu.
  • Your program must generate logically correct output.

Specifications

// Specification C1 - Communications Option

This makes the start of the communications option code.

// Specification C2 - Engine Failure Option

This makes the start of the engine failure option code.

// Specification C3 - In-Flight Icing Option

This makes the start of the in-flight icing option code.

// Specification B1 - Menu Input Validation

Only allow the client to enter valid numbers for the main menu. Quit the program with invalid entries. You can just display a gen- eral error message for this specification.

// Specification B2 - Icing Input Validation

Only allow a valid range for the de-icing menu. Exit the program with invalid input.

// Specification B3 - Date

On the first line of the main menu, include the current date. You can get the system date and use that, or you can prompt the client for the date. Your choice.

Figure 2: This is the engine failure menu selection: see image.

// Specification A1 - Alpha Menu

Change from a numeric menu to an alphabetic menu. See figure 3 for an example menu. Keep your numeric menu code - just com- ment it out. I only want 1 menu in operation.

// Specification A2 - Menu Input Validation

Only allow the client to enter valid letters for the main menu. Quit the program with invalid entries. You can just display a general error message for this specification. The replaces specification B1, so also like Specification A1 , just comment out the validation code which doesn't apply to a numeric menu.

// Specification A3 - One Function

I want to see at least one function in an "A" program. I don't care what you do with it, just write one. Dont forget the function prototype.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.