Implement a class that performs the power loading computation for light plane. Y
ID: 3664095 • Letter: I
Question
Implement a class that performs the power loading computation for light plane. Your class should have a float field for the maximum velocity for the aircraft (Vmax). The units for the maximum velocity are knots.
Look at the attached file for more informations to create this class.
***Hint***
Recall that a class has the following structure:
public class PowerLoading
{
// fields
// constructor (s)
// accessors and mutators
// general methods
}
Your class should have only one field that will contain vMax.
The constructor should initialize vMax.
vMax may have an accessor and mutator.
One general method for each type of aircraft.
Explanation / Answer
See the below java code is implemented as per given problem in above..
public class PowerLoading
{
private double Vmax = 0.0;
public PowerLoading()
{
Vmax = 0.0;
}
public PowerLoading(double load)
{
Vmax = load;
}
public double getVmax()
{
return Vmax;
}
public void setVmax(double vamx1)
{
Vmax = vamx1;
}
public void Fixed_Gear_Normal()
{
double w = 215 * Vmax - 61 ;
System.out.println("W/h is :"+w);
}
public void Retract_Gear_Normal()
{
double w = 276 * Vmax - 65 ;
System.out.println("W/h is :"+w);
}
public void Fixed_Smooth_Normal()
{
double w = 248 * Vmax - 61 ;
System.out.println("W/h is :"+w);
}
public void Retract_Gear_Smooth()
{
double w = 680 * Vmax - 79 ;
System.out.println("W/h is :"+w);
}
public void Acrobatic()
{
double w = 172 * Vmax - 61 ;
System.out.println("W/h is :"+w);
}
public void RagWings()
{
double w = 511 * Vmax - 75 ;
System.out.println("W/h is :"+w);
}
public void Ultralights()
{
double w = 325 * Vmax - 75` ;
System.out.println("W/h is :"+w);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.