home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
EDUCATIN
/
MDLPLNE2.LBR
/
WNGLDG12.PQS
/
WNGLDG12.PAS
Wrap
Pascal/Delphi Source File
|
2000-06-30
|
6KB
|
202 lines
{$A-}
PROGRAM Wingldg12;
{WNGLDG12.PAS - WingLoading version 1.2 a Turbo Pascal program based on a}
{Microsoft Basic program orginally written by Dick Phillips, President of}
{IMAA. The program will calculate the wing area and wing loading for a}
{selection of wing types and configurations. Turbo Pascal conversion by}
{Curtis W. Givens 22 July 86}
PROCEDURE Menu;FORWARD;
PROCEDURE TWM;{Taperwing Mono-plane}
VAR
S : Real;{Wingspan}
R : Real;{Root Chord}
T : Real;{Tip Chord}
W : Real;{Weight}
Choice : Integer;
BEGIN
WRITELN('Please remember to use decimal fractions for all inputs');
WRITELN;
WRITELN('Wingspan?');
READLN(S);
WRITELN('Tip Chord?');
READLN(T);
WRITELN('Root Chord?');
READLN(R);
WRITELN('Weight in Pounds?');
READLN(W);
WRITELN;
WRITELN('The wing area is',((((R+T)/2)*S)/144):8:3, 'square feet.');
WRITELN;
WRITELN('The Wing Loading is',(W*16)/((((R+T)/2)*S)/144):8:3, 'oz per sqft.');
WRITELN;
WRITELN('Do another? Yes=1 No=Any other integer');
READLN(Choice);
IF Choice=1 THEN Menu ELSE HALT;
END;
PROCEDURE CCM;{Constant Chord Mono-plane}
VAR
S : Real;{Wingspan}
C : Real;{Chord}
W : Real;{Weight}
Choice : Integer;
BEGIN
WRITELN('All inputs in decimal fractions');
WRITELN;
WRITELN('Wingspan?');
READLN(S);
WRITELN('Chord?');
READLN(C);
WRITELN('Weight-lbs?');
READLN(W);
WRITELN('The wing area is',((S*C)/144):8:3, 'square feet.');
WRITELN;
WRITELN('The wing loading is',((W*16)/((S*C)/144)):8:3, 'ounces per square ft.');
WRITELN;
WRITELN('Do another? Yes=1 No=Any other integer');
READLN(Choice);
IF Choice=1 THEN Menu ELSE HALT;
END;
PROCEDURE CCB;{Constant chord bi-plane}
VAR
US : Real;{upper wing span}
UC : Real;{upper wing chord}
LS : Real;{lower wing span}
LC : Real;{lower wing Chord}
W : Real;{weight}
Choice : Integer;
BEGIN
WRITELN('All inputs in decimal fractions');
WRITELN;
WRITELN('Upper Wing Span?');
READLN(US);
WRITELN('Upper Wing Chord?');
READLN(UC);
WRITELN('Lower Wing Span?');
READLN(LS);
WRITELN('Lower Wing Chord?');
READLN(LC);
WRITELN('Weight - lbs?');
READLN(W);
WRITELN('The wing area is',(((US*UC)+(LS*LC))/144):8:3, 'square feet.');
WRITELN;
WRITELN('The wing loading is', ((W*16)/(((US*UC)+(LS*LC))/144)):8:3, 'ounces per square foot.');
WRITELN;
WRITELN('Do another? Yes=1 No=Any other integer');
READLN(Choice);
IF Choice=1 THEN Menu ELSE HALT;
END;
PROCEDURE TWBU;{Tapper wing bi-plane with unequal wings}
VAR
US : Real;{Upper wing span}
UT : Real;{Upper wing tip chord}
UR : Real;{Upper wing root chord}
LS : Real;{Lower wing span}
LT : Real;{Lower wing tip chord}
LR : Real;{Lower wing root chord}
W : Real;{Weight}
Choice : Integer;
BEGIN
WRITELN('All inputs in decimal fractions');
WRITELN;
WRITELN('Upper Wing Span?');
READLN(US);
WRITELN('Upper Wing Tip Chord?');
READLN(UT);
WRITELN('Upper Wing Root Chord?');
READLN(UR);
WRITELN('Lower Wing Span?');
READLN(LS);
WRITELN('Lower Wing Tip Chord?');
READLN(LT);
WRITELN('Lower Wing Root Chord?');
READLN(LR);
WRITELN('Weight - lbs?');
READLN(W);
WRITELN('The wing area is',(((((UT+UR)/2)*US)+(((LT+LR)/2)*LS))/144):8:3,'square feet.');
WRITELN;
WRITELN('The wing loading is',((W*16)/(((((UT+UR)/2)*US)+(((LT+LR)/2)*LS))/144)):8:3, 'ounces per square foot.');
WRITELN;
WRITELN('Do another? Yes=1 No=Any other integer');
READLN(Choice);
IF Choice=1 THEN Menu ELSE HALT;
END;
PROCEDURE TWB;{Taper wing bi-plane upper and lower wing equal}
VAR
S : Real;{Wing Span}
T : Real;{Tip Chord}
R : Real;{Root Chord}
W : Real;{Weight}
Answer : Integer;
Choice : Integer;
BEGIN
WRITELN('All inputs in decimal fractions');
WRITELN;
WRITELN('Are the upper and lower wings identical? Yes = 1 No = any other integer');
READLN(Answer);
IF Answer <>1 THEN TWBU ELSE
BEGIN
WRITELN('Wing span?');
READLN(S);
WRITELN('Tip chord?');
READLN(T);
WRITELN('Root chord?');
READLN(R);
WRITELN('Weight - lbs?');
READLN(W);
WRITELN;
WRITELN('The wing are is',((((T+R)/2)*2*S)/144):8:3, 'square feet.');
WRITELN;
WRITELN('The wing loading is',((W*16)/(((T+R)/2)*2*S/144)):8:3, 'ounces per square foot.');
WRITELN;
WRITELN('Do another? Yes=1 No=Any other integer');
READLN(Choice);
IF Choice=1 THEN Menu ELSE HALT;
END;{IF}
END;
PROCEDURE Menu;
VAR
Choice : Integer;
BEGIN
WRITELN('Please select your wing type from the following list.');
WRITELN;
WRITELN('Taper Wing Mono-Plane = 1');
WRITELN;
WRITELN('Taper wing Bi-Plane = 2');
WRITELN;
WRITELN('Constant Chord Mono-Plane = 3');
WRITELN;
WRITELN('Constant Chord Bi-Plane = 4');
WRITELN;
READLN(Choice);
IF Choice=1 THEN TWM ELSE
IF Choice=2 THEN TWB ELSE
IF Choice=3 THEN CCM ELSE
IF Choice=4 THEN CCB ELSE
HALT;
END;{Menu}
BEGIN
Menu
END.