Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #support me https://salamedia.id
- unit U_proses;
- interface
- uses crt;
- function PROS_1 ( var x,y,z,t,k,kur : real):real;
- function pros_2 ( var s,ls,kl : real):real;
- function PROS_3 ( var a,b,c,Luas,Keliling:Real):real;
- function PROS_4 ( var LL,KL,Diameter,JariJari:Real):real;
- function PROS_5 ( var V1,V2,V3,T1,T2,T3,S1,S2,S3,RataRataJarak:Real):real;
- Procedure PROS_6 (var X:Integer; y : string);
- procedure PROS_7 ( var a,b,c,d,e : real);
- function PROS_8 ( var X:integer):integer;
- procedure PROS_9 (IM :string ;UTS,UAS,TUGAS,KEHADIRAN,NA:real);
- Procedure PROS_10 (n,b,c:integer);
- Procedure PROS_11 (N,i,jumlahBarisan:integer);
- Procedure PROS_12 (x,n,firstterm, secondterm, nextterm:integer);
- implementation
- function PROS_1 ( var x,y,z,t,k,kur : real):real;
- begin
- gotoxy(43,04);
- readln(x);
- gotoxy(43,06);
- readln(y);
- gotoxy(43,08);
- readln(z);
- t := x + y+z;
- k := x * y * z;
- kur := x - y - z;
- gotoxy(44,10);write(t:0:2);
- gotoxy(44,12);write(k :0:2);
- gotoxy(44,11);write(kur:0:2);
- end;
- function pros_2 ( var s,ls,kl : real):real;
- begin
- gotoxy(48,04);
- readln(s);
- ls := (s * s * sqrt(3)) / 4;
- kl := 3 * s;
- gotoxy(50,07);write(ls:0:2);
- gotoxy(50,08);write(kl:0:2);
- end;
- function PROS_3 ( var a,b,c,Luas,Keliling:Real):real;
- begin
- gotoxy(43,04);
- Readln(a);
- gotoxy(43,06);
- Readln(b);
- c:=sqrt(a*a+b*b);
- luas:=0.5*a*b;
- Keliling:=a+b+c;
- gotoxy(47,09);write(Luas:0:2);
- gotoxy(47,08);write(Keliling:0:2);
- end;
- function PROS_4 ( var LL,KL,Diameter,JariJari:Real):real;
- begin
- gotoxy(47,04);
- Readln(Diameter);
- JariJari:=Diameter/2;
- LL:=3.14*JariJari*JariJari;
- KL:=2*3.14*JariJari;
- gotoxy(47,07);write(LL:0:2);
- gotoxy(47,08);write(KL:0:2);
- end;
- function PROS_5 ( var V1,V2,V3,T1,T2,T3,S1,S2,S3,RataRataJarak:Real):real;
- begin
- gotoxy(49,04);
- Readln(V1);
- gotoxy(49,06);
- Readln(T1);
- gotoxy(49,08);
- Readln(V2);
- gotoxy(49,10);
- Readln(T2);
- gotoxy(49,12);
- Readln(V3);
- gotoxy(49,14);
- Readln(T3);
- S1:=V1*T1;
- S2:=V2*T2;
- S3:=V3*T3;
- RataRataJarak:=(S1+S2+S3);
- gotoxy(49,16);write(S1:0:2);
- gotoxy(49,17);write(S2:0:2);
- gotoxy(49,18);write(S3:0:2);
- gotoxy(49,20);write(RataRataJarak:0:2);
- end;
- Procedure PROS_6 (var X:Integer;y : string);
- begin
- gotoxy(47,04);
- Readln(X);
- gotoxy(32,07);
- if (x < 0) then
- y := 'NEGATIF'
- else
- y := 'POSITIF';
- if (x = 0) then
- write('nol')
- else
- if (x mod 2 = 0) then
- write('BILANGAN GENAP ',y)
- else
- write('BILANGAN GANJIl ',y);
- end;
- procedure PROS_7 ( var a,b,c,d,e : real);
- begin
- gotoxy(23,04);Writeln('Masukan Jumlah Pembelian :');
- gotoxy(23,05);Write('Jumlah Pembelian:Rp.');
- Readln(a);
- gotoxy(23,07);Write('Jenis Konsumen');
- gotoxy(23,08);write('1:Pelanggan,2:Non-Pelanggan: ');
- Readln(b);
- if (b = 1) then
- c:=0.1*a
- else
- c:=0;
- e:=(Trunc(a/1000000))*30000;
- d:=a-c+e;
- gotoxy(23,10);Writeln('==============================');
- gotoxy(23,11);Writeln(' Struk Pembayaran ');
- gotoxy(23,12);Writeln('------------------------------');
- gotoxy(23,13);Writeln('Jumlah Pembelian : Rp.',a:0:3);
- gotoxy(23,14);Writeln('Potongan : Rp.',c:0:3);
- gotoxy(23,15);Writeln('Cashback : Rp.',e:0:3);
- gotoxy(23,16);Writeln('------------------------------');
- gotoxy(23,17);Writeln('Total Pembayaran : Rp.',d:0:3);
- gotoxy(23,18);Writeln('==============================');
- end;
- function PROS_8 ( var X:integer):integer;
- begin
- gotoxy(47,04);
- Readln(x);
- gotoxy(33,07);
- case X of
- 0:Writeln('nol');
- 1:Writeln('satu');
- 2:Writeln('dua');
- 3:Writeln('tiga');
- 4:Writeln('empat');
- 5:Writeln('lima');
- 6:Writeln('enam');
- 7:Writeln('tujuh');
- 8:Writeln('delapan');
- 9:Writeln('sembilan');
- else
- gotoxy(33,07);Writeln('salah entri:ketik bilangan 0..9');
- end;
- end;
- procedure PROS_9 (IM :string ;UTS,UAS,TUGAS,KEHADIRAN,NA:real);
- begin
- gotoxy(50,04);
- Readln(UTS);
- gotoxy(50,06);
- Readln(UAS);
- gotoxy(50,08);
- Readln(TUGAS);
- gotoxy(50,10);
- readln(KEHADIRAN);
- KEHADIRAN:=(KEHADIRAN/16)*100;
- NA:=(0.3* UTS)+(0.4* UAS)+(0.2*TUGAS)+(0.1*KEHADIRAN);
- case Round(NA) of
- 0..100:
- begin;
- case Round(NA) of
- 81..100:IM := ' A';
- 66..80: IM := ' B';
- 51..65: IM := ' C';
- 41..50: IM := ' D';
- else IM:= ' E';
- end;
- gotoxy(50,12);Writeln('',NA:0:2);
- gotoxy(50,13);Write('',IM);
- end;
- else
- gotoxy(50,12);Write('Salah nilai');
- end;
- end;
- Procedure PROS_10 (n,b,c:integer);
- begin
- Gotoxy(48,04);
- readln(n);
- Gotoxy(48,06);
- readln(b);
- for c := n to b do
- Begin
- Gotoxy(32,08); write(' ',++c);
- End;
- end;
- Procedure PROS_11 (N,i,jumlahBarisan:integer);
- begin
- Gotoxy(48,04);
- Readln(N);
- Gotoxy(48,06);
- Readln(jumlahBarisan);
- Gotoxy(32,08);
- for i:=1 to jumlahBarisan do
- begin
- Write(N*i,'');
- end;
- end;
- Procedure PROS_12 (x,n,firstterm, secondterm, nextterm:integer);
- BEGIN
- firstterm := 0;
- secondterm := 1;
- gotoxy(45,04);
- readln(n);
- for n := 1 to n do
- begin
- if n = 1 then
- writeln(firstterm)
- else if n = 2 then
- writeln(secondterm)
- else
- begin
- nextterm := firstterm + secondterm;
- firstterm := secondterm;
- secondterm := nextterm;
- writeln(nextterm);
- end;
- end;
- end;
- begin
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement