Java Lab \"Wing Class\", Please help me with writing the java code below, thank
ID: 3875649 • Letter: J
Question
Java Lab "Wing Class",
Please help me with writing the java code below, thank you!
Build and test the Wing class using Java Your class should have the following fields Field NameDescription span chord rho vCruise vStall cLiftMax cLiftCruise altitudeTO altitudeCruise Cruise altitude index (0-20 Wing span in feet. Wing chord in feet Table ot standard day, and hot day atmosphere density. In slugs Cruise speed in feet per second (fps). Knots x 1.689 = fps Stall speed in fps Maximum lift coefficient. Dimensionless Cruise lift coefficient. Usually found at L/D max in airfoil datasheet. Dimensionless Take off altitude index (0-20 Your class should have the following methods: Dynamic Pressure, q Variable Name Description Rho. Density of air at given altitude. Standard or hot da Velocity in fps. Knots x 1.689 = fps Dynamic pressure Total Lift (lbs.) TotalLift span *chord *q*CL. CL is the appropriate lift coefficient. Note that span * chord is wing area Wing Loading (Ibs. /square foot) WingLoading = Tota!Lift / WingAreaExplanation / Answer
public class Wing
{
double span=0;
double chord=0;
double rho=0;
double vCruise=0;
double vStall=0;
double cLiftMax=0;
double cLiftCruise=0;
double altitudeTO=0;
double altitudeCruise=0;
double DynamicPressure(){
return 0.5*rho*vCruise*vCruise;
}
double TotalLift(){
return span * chord * DynamicPressure() * cLiftMax;
}
double WingLoading(){
return TotalLift()/(span*chord);
}
void test(){
span=30;
chord=4.6;
rho=0.00187;
vCruise=120*1.689;
vStall=45*1.689;
cLiftMax=1.4;
cLiftCruise=0.3;
altitudeTO=0;
altitudeCruise=8;
System.out.println("Dynamic Pressure: " + DynamicPressure());
System.out.println("Total Lift: " + TotalLift());
System.out.println("Wing Loading: " + WingLoading());
}
// arguments are passed using the text field below this editor
public static void main(String[] args)
{
Wing w = new Wing();
w.test();
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------
Test run:-
---------------
Dynamic Pressure: 38.409035544
Total Lift: 7420.6256671008
Wing Loading: 53.77264976159999
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.