Task 2 - Flying.java The two forces acting on an aircraft in flight are lift (acting upwards) and weight (acting downwards). If the lift of the aircraft equals the weight of the aircraft, then the aircraft neither goes up nor down, it is in level flight. If the lift is greater than the weight, then the aircraft climbs (gains altitude). If the weight is greater than the lift, then the aircraft descends (loses altitude) Write a Java program named Flying that calculates whether an aircraft is flying level, climbing or descending. The basic equation to calculate this lift is known as the Flight Equation. The Flight Equation is: L = 1/2*p* v? * s *cl where L = lift (in Newtons), this must equal the weight of the aircraft for the aircraft to fly. To convert kilograms to Newtons multiply kilograms by 9.8 p = density of the air, in kg / m3 This value is a maximum of 1.2 at sea level and decreases as altitude (height) increases v = current speed, in metres / second of the aircraft. s = surface area of the wings, in m2 cl = lift co-efficient, a constant value (with no units) that describes how effective the aircraft wing is at generating lift. Your program will prompt (ask) the user to enter all the details for an aircraft, in the order as shown in the examples below, then, using the Flight Equation above, calculate a value for the lift figure. The lift figure must be converted to kilograms, or the weight figure converted to Newtons, either way, so long as they are in the same unit. The weight and the lift are compared. If the weight is the same as the lift + 250, then the aircraft is flying straight and level. If the weight is greater than lift + 250, then the aircraft is descending (losing altitude) and if the weight is less than lift - 250, then the aircraft is climbing (gaining altitude)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
I want the full output in a picture 3 examples
Some sample runs of the program are included below (user input is in bold):
Example 1
> java Flying
Enter air density (p) » 1.2
Enter velocity (m/s) » 79.03
Enter wing surface area (m^2) >> 37.16
Enter lift co-efficient >> 1.276
Enter aircraft name >> F/A 18 Hornet
Enter aircraft weight >> 18136
The F/A 18 Hornet aircraft is flying level
Example 2
> java Flying
Enter air density (p) >> 1.2
Enter velocity (m/s) >> 65.26
Enter wing surface area (m^2) >> 37.16
Enter lift co-efficient >> 1.276
Enter aircraft name >> F/A 18 Hornet Enter aircraft weight >> 18136
The F/A 18 Hornet aircraft is descending
Example 3
> java Flying
Enter air density (p) >> 1.2
Enter velocity (m/s) >> 80.04
Enter wing surface area (m^2) >> 37.16
Enter lift co-efficient >> 1.276
Enter aircraft name >> F/A 18 Hornet
Enter aircraft weight >> 18136
The F/A 18 Hornet aircraft is climbing
Note: The user input must be in the order shown above and the aircraft name must be
able to accept names of more than one word. (Marks will be deducted otherwise).
Transcribed Image Text:Some sample runs of the program are included below (user input is in bold): Example 1 > java Flying Enter air density (p) » 1.2 Enter velocity (m/s) » 79.03 Enter wing surface area (m^2) >> 37.16 Enter lift co-efficient >> 1.276 Enter aircraft name >> F/A 18 Hornet Enter aircraft weight >> 18136 The F/A 18 Hornet aircraft is flying level Example 2 > java Flying Enter air density (p) >> 1.2 Enter velocity (m/s) >> 65.26 Enter wing surface area (m^2) >> 37.16 Enter lift co-efficient >> 1.276 Enter aircraft name >> F/A 18 Hornet Enter aircraft weight >> 18136 The F/A 18 Hornet aircraft is descending Example 3 > java Flying Enter air density (p) >> 1.2 Enter velocity (m/s) >> 80.04 Enter wing surface area (m^2) >> 37.16 Enter lift co-efficient >> 1.276 Enter aircraft name >> F/A 18 Hornet Enter aircraft weight >> 18136 The F/A 18 Hornet aircraft is climbing Note: The user input must be in the order shown above and the aircraft name must be able to accept names of more than one word. (Marks will be deducted otherwise).
Task 2 - Flying.java
The two forces acting on an aircraft in flight are lift (acting upwards) and weight (acting
downwards). If the lift of the aircraft equals the weight of the aircraft, then the aircraft
neither goes up nor down, it is in level flight. If the lift is greater than the weight, then the
aircraft climbs (gains altitude). If the weight is greater than the lift, then the aircraft
descends (loses altitude)
Write a Java program named Flying that calculates whether an aircraft is flying level,
climbing or descending.
The basic equation to calculate this lift is known as the Flight Equation.
The Flight Equation is:
L = 1/2*p* v² * s *cl
where
L = lift (in Newtons), this must equal the weight of the aircraft for the aircraft to fly.
To convert kilograms to Newtons multiply kilograms by 9.8
p = density of the air, in kg / m3
This value is a maximum of 1.2 at sea level and decreases as altitude (height)
increases
v = current speed, in metres / second of the aircraft.
s = surface area of the wings, in m?
cl = lift co-efficient, a constant value (with no units) that describes how effective the
aircraft wing is at generating lift.
Your program will prompt (ask) the user to enter all the details for an aircraft, in the
order as shown in the examples below, then, using the Flight Equation above, calculate
a value for the lift figure. The lift figure must be converted to kilograms, or the weight
figure converted to Newtons, either way, so long as they are in the same unit. The
weight and the lift are compared. If the weight is the same as the lift + 250, then the
aircraft is flying straight and level. If the weight is greater than lift + 250, then the aircraft
is descending (losing altitude) and if the weight is less than lift - 250, then the aircraft is
climbing (gaining altitude)
Transcribed Image Text:Task 2 - Flying.java The two forces acting on an aircraft in flight are lift (acting upwards) and weight (acting downwards). If the lift of the aircraft equals the weight of the aircraft, then the aircraft neither goes up nor down, it is in level flight. If the lift is greater than the weight, then the aircraft climbs (gains altitude). If the weight is greater than the lift, then the aircraft descends (loses altitude) Write a Java program named Flying that calculates whether an aircraft is flying level, climbing or descending. The basic equation to calculate this lift is known as the Flight Equation. The Flight Equation is: L = 1/2*p* v² * s *cl where L = lift (in Newtons), this must equal the weight of the aircraft for the aircraft to fly. To convert kilograms to Newtons multiply kilograms by 9.8 p = density of the air, in kg / m3 This value is a maximum of 1.2 at sea level and decreases as altitude (height) increases v = current speed, in metres / second of the aircraft. s = surface area of the wings, in m? cl = lift co-efficient, a constant value (with no units) that describes how effective the aircraft wing is at generating lift. Your program will prompt (ask) the user to enter all the details for an aircraft, in the order as shown in the examples below, then, using the Flight Equation above, calculate a value for the lift figure. The lift figure must be converted to kilograms, or the weight figure converted to Newtons, either way, so long as they are in the same unit. The weight and the lift are compared. If the weight is the same as the lift + 250, then the aircraft is flying straight and level. If the weight is greater than lift + 250, then the aircraft is descending (losing altitude) and if the weight is less than lift - 250, then the aircraft is climbing (gaining altitude)
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education