Calculates whether a plane successfully lands or not, JAVA Programming

Assignment Help:

Write a program called LandThePlane that calculates whether a plane successfully lands or not.
 
The program begins by prompting (asking) the user for the following details, in the order shown in the example below.
 
Distance to airport (in metres)   - an integer value

Name of the airport     - text, can be more than one word

Current height (in metres)   - an integer value

Current speed (in kilometres / hour) - an integer value

Current fuel (in litres)    - an integer value

Next the user is prompted (asked) to enter an integer figure between -4 and +4 inclusive. This figure is the Engine change figure, which changes the speed of the plane and how fast the plane is losing height, as explained below.

Assume that the speed change occurs immediately. 

This program operates in metres and seconds. First the speed must be converted from kilometres / hour to metres / sec. The conversion factor is 0.27777.
 
That is, 1 km / hr = 0.27777 m /s
 
Based on the Acceleration change figure entered by the user, the new speed is calculated, using the formula
 
new speed = old speed + ( old speed * Acceleration change )
 
This new speed is still in metres / second, and becomes the current speed.
 
Recall that the new speed is applied immediately.
 
Next the program, using the new speed, works out the new distance to the airport by subtracting how much distance has been covered, at this new speed, in 10 seconds. 
 
The formula is:
 
new distance = old distance - (current speed * time) 
(where time = 10 seconds)
 
This gives a new figure, in metres, of the distance to the airport. This figure can be negative, as is explained below.
 
Next, the program calculates the new height of the plane, also in meters. This figure may also be negative, as is explained below. 

new height = old height -  ( current speed * rate of descent * time )

where
   time = 10 seconds
   rate of descent = 0.1369
 
Regardless of whether the plane increases or decreases speed, the plane always loses height (goes lower)
 
The plane uses 200 litres of fuel every 10 seconds.
 
To successfully land the plane distance must be between 0 and -300 AND height must be 0 or less AND fuel must be 0 or greater AND speed must be 0 or greater.
 
 why can distance be < 0?
 
  0 represents the very edge of the runway, so long as the plane touches down within the first 300 metres of the runway, then it has enough runway to slow down to a stop. If the plane lands any further down the runway, then it does not have enough runway to stop in time and crashes off the end of the runway.

 why can height be < 0?
 
  We are using a time slice of 10 seconds. The plane could successfully land anywhere within this 10 second window but the calculations could show a negative value. For instance, if the plane landed successfully in the first second of the 10 second window, the program would still be calculating the change in height for the remaining 9 seconds of the time slice, so the final, displayed answer, would be negative.


Related Discussions:- Calculates whether a plane successfully lands or not

Define in detail the building of webpage, Question 1 Describe the browser ...

Question 1 Describe the browser components and its features Question 2 Define in detail the building of webpage Question 3 How to use forms? Describe with an example

Questions pseudocodes, 1. Write the pseudocode to get the input of 10 integ...

1. Write the pseudocode to get the input of 10 integers from the user and add them up and output the total. (4 points) 2. Compute the output of following pseudocode. Assume that

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

I want linux server expert with tomcat skills, I want Linux server expert w...

I want Linux server expert with Tomcat skills Project Description: I want a Linux server expert to look in to an issue with my domain. It is down since three days as there is

Conversation to html, Conversation to HTML Project Description: We ha...

Conversation to HTML Project Description: We have inner pages to be transformed into html for travel domain. 1. Flight search page for one way and round trip 2. Bus res

Program to change base system, Write a program called BaseConverter that pr...

Write a program called BaseConverter that prompts (asks) the user for a base 10 number and another number, between 2 and 10 inclusive. This second number is the base to which to co

What are trojan horses, What are Trojan Horses? Trojan Horses are unlik...

What are Trojan Horses? Trojan Horses are unlike viruses usually they are stand-alone programs. The look such as what they are not. They appear to be something harmless and int

Package inheritance hierarchy program, (Package Inheritance Hierarchy) Pack...

(Package Inheritance Hierarchy) Package-delivery services, such as FedEx®, DHL® and UPS®, offer a number of different shipping options, each with specific costs associated. Create

Video course on computer security needed, Video course on computer security...

Video course on computer security needed Project Description: We want a video course on computer security. Just like the way lynda provides. Skills required are Computer S

Write Your Message!

Captcha
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