Program that let the pilot issue commands to the aircraft

Assignment Help C/C++ Programming
Reference no: EM132281186

Object-Oriented Programming Fundamentals Assignment Part B - Angles and lights explained

Assessment Objectives:

  • To practise using the Math class.
  • To practise reading from the console and writing to the screen.
  • To practice using switch and/or multiway selection branches.
  • To practise using loops (repetition).

What we want the program to do:

We need to write a program, in Java, that will let the pilot issue commands to the aircraft to get it down safely on the flight deck.

The program starts by prompting (asking) the user to enter the (start) approach speed in knots.

A knot is a nautical mile and is the unit used in the navy and by the navy pilots.

After the user enters the approach speed, the user is then shown the menu and the pilot picks a command.

The effect of this command is then calculated and the updated information about the aircraft is displayed. If the aircraft has crashed or has landed, then the information is different.

If the aircraft does not land, overshoot or crash, then the program presents the menu again and the user makes another choice (or the same choice again) and the program calculates the updated position of the aircraft and displays the information to the pilot (the user)'.

This continues until the aircraft successfully lands on the flight desk, the aircraft crashes or the aircraft overshoots the landing area.

To successfully land, the aircraft must have its hook down and its gear down when it is in the valid landing zone.

To be in the correct landing zone with the hook up and gear down, means the aircraft doesn't stop in time and has to go around, this is known as an overshoot.

To be in the correct landing zone with the gear (landing gear) up means that the aircraft crashes. (Whether the hook is up or down doesn't matter).

At any time, the user can issue the command Eject. This displays a message and stops the program, the aircraft crashes into the ocean.

The commands and the changes they make are listed below.

Note that commands must be case insensitive. That is, HOOK Down and hook dOWN must have the same effect.

If the aircraft is still on approach, that is, it hasn't landed, overshot or crashed, the new height is shown along with the distance (which is to the back (stern) of the flight deck) and the glide path angle.

The starting state of the aircraft is gear up, hook up and flaps level.

An invalid command should not change anything about the conditions of the plane.

The commands and their effects are listed below.

Recall that the aircraft is always moving forward at the speed set at the start of the program.

Only certain commands are allowed, these are entered as text (not numbers) Invalid commands should be ignored.

The allowed commands and the change they make:

Gear Up - This increases the height + 20 feet (this is a one off effect) If the gear is already up, then an appropriate message is displayed to the screen and the height is not changed.

Gear Down - This decreases the height 20 feet (this is a one off effect) If the gear is already down, then an appropriate message is displayed to the screen and the height is not changed.

Hook up - This increases the height + 10 feet (this is a one off effect) If the hook is already up, then an appropriate message is displayed to the screen and the height is not changed.

Hook Down - This decreases the height 10 feet (this is a one off effect) If the hook is already down, then an appropriate message is displayed to the screen and the height is not changed.

Flaps Up - This increases the height + 15 feet (this is a one off effect) If the flaps are already fully up, then an appropriate message is displayed to the screen. The height is changed by +15, even if the flaps are already fully up.

Flaps Down - This decreases the height 15 feet (this is a one off effect) If the flaps are already fully down, then an appropriate message is displayed to the screen. The height is changed by - 15, even if the flaps are already fully down.

To go from flaps fully up to flaps fully down requires 2 steps, the first time the Flaps down command is issued the flaps go to level, then the next time the flaps down command is issued, they go to fully down.

If the flaps are level, they do not change the height on the next time through the menu.

This is the same for flaps up, if the flaps are fully down, then the command flaps up brings the flaps to level, the next flaps up command would see the flaps go from level to fully up.

Maintain - This command does not change the height, just flies straight and level. Note that the one thing this command must do is set the flaps to the level position. The distance changes.

Power Up - This command increases the height by 5.

Power Down - This command decreases the height by 5.

Eject - Ends the program, after a screen message.

The distance, angle and height figures must be displayed to 2 decimal places.

Your program must correctly deal with the user entering an invalid command (not one of the commands listed above). If the user enters an invalid command, an appropriate message is displayed to the screen, and nothing is changed, just go straight back to the menu again.

The program ends when the aircraft lands, crashes or overshoots, or the user selects the Eject command.

Attachment:- Assignment File.rar

Reference no: EM132281186

Program to determine the smallest number out of 15 numbers

you are a mortgage broker who is determining whether you should provide a mortgage to perspective home purchasers. If you are willing to provide a mortgage, you need to deci

Prevent illegal moves without crashing

Your program must gracefully handle the case when a player tries to add a non-number to a square, or add a number that violates the Sudoku rules. It should prevent illegal mov

Consulting firm hired to develop a program

Your program must provide a menu to the user. This menu should list five different products of your choice. Once the user selects one product, they should specify which stat

Program to store lists of names and ages in parallel arrays

Write a C++ program that stores lists of names (the last name first) and ages in parallel arrays and sorts the names into alphabetical order keeping the ages with the cor

Define a class named payment that contains a member variable

Finally, redefine the paymentDetails method to include all credit card information in the printout. Create a main method that creates at least two CashPayment and two Credit

Performance of disk memory system

Suppose a regional computer centre A wants to evaluate the performance of its disk memory system. One measure of performance is the average time between failures of its disk

Calculate gpa

You need to take input from user study year (proper value check from 1 to 4). Take input semester (proper value check 1 to 8) Calculate GPA (use Loop, calculate GPA for semest

Write a program the contains an array of 1000 elements name

Write a function named equals() that accepts two char arrays and return true if both arrays have the same characters in the same order. The function should return false otherw

Reviews

len2281186

4/12/2019 1:52:44 AM

This is an individual Assignment. You are not permitted to work as a Pair Programming partnership or any other group when writing this assignment. Submission Details: Full instructions on how to submit electronic copies of your source code files from your latcs8 account are given at the end. If you have not been able to complete a program that compiles and executes containing all functionality, then you should submit a program that compiles and executes with as much functionality as you have completed. (You may comment out code that does not compile.) Note you must submit electronic copies of your source code files using the submit command on latcs8. Ensure you submit the required file.

len2281186

4/12/2019 1:52:37 AM

Marking Scheme: This assignment is worth 7% of your final mark in this subject. Marking scheme: 90% for the code executing correctly and 10%, you will be asked to explain (and / or alter) parts of your code. Please also note carefully that whilst we encourage innovation and exploring java beyond what has been presented in the subject to date, above all, we encourage understanding. All of the Tasks that follow can be solved using techniques that have been presented in lectures, lecture / workshops and labs so far.

len2281186

4/12/2019 1:52:29 AM

These are the techniques and knowledge that we will later be examining in the Real Time Test (20 marks) and the exam (50 marks). Code and techniques that are outside the material presented will not be examined, of course. You are free to solve the Tasks below in any way, with one condition. Submitting an assignment with code outside what has been presented so far and not attending the marking execution test will result in an automatic mark of 0, regardless of the correctness of the submission.

Write a Review

 
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd