49385237 Program Turbo Pascal

Description
PROGRAM RUMUS STATISTIK { CONTOH PROGRAM KE:12 PROGRAM : PENYELESAIAN RUMUS STATISTIK P= Yi+ Xi-Yi+ (X-Yi)2 DENGAN ARRAY 1 DIMENSI DICOBA OLEH : FOLO'O GULO } PROGRAM RUMUS_STATISTIK; USES WINCRT; TYPE LARIK = ARRAY[1..30] OF REAL; VAR P,RATAXY,RATAX,JUMY, JUMX, JUMXY:REAL; X,Y : LARIK; N : INTEGER; LAGI :CHAR; PROCEDURE BACA_DATA; VAR I:INTEGER; BEGIN WRITELN('PROGRAM PENYELESAIAN STATISTIK'); WRITELN; WRITE('BANYAK DATA MASING-MASING X DAN Y=');READLN(N); WRITELN; WRITELN('NO DATA X DATA Y ');

Please download to get full document.

View again

of 7
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information
Category:

Documents

Publish on:

Views: 5 | Pages: 7

Extension: PDF | Download: 0

Share
Transcript
  PROGRAM RUMUS STATISTIK  {CONTOH PROGRAM KE:12PROGRAM: PENYELESAIAN RUMUS STATISTIK P= Yi+ Xi-Yi+ (X-Yi)2 DENGAN ARRAY 1 DIMENSIDICOBA OLEH: FOLO'O GULO}PROGRAM RUMUS_STATISTIK;USES WINCRT;TYPE LARIK = ARRAY[1..30] OF REAL;VAR P,RATAXY,RATAX,JUMY, JUMX, JUMXY:REAL;X,Y : LARIK;N : INTEGER;LAGI :CHAR;PROCEDURE BACA_DATA;VAR I:INTEGER;BEGINWRITELN('PROGRAM PENYELESAIAN STATISTIK');WRITELN;WRITE('BANYAK DATA MASING-MASING X DAN Y=');READLN(N);WRITELN;WRITELN('NO DATA X DATA Y ');WRITELN('...............................................');FOR I:=1 TO N DOBEGINGOTOXY (3,6+I);WRITE(I);GOTOXY(13,6+I);READ(X[IGOTOXY(26,6+I);READLN(Y[IEND;WRITELN('..............................................');READLN;END;PROCEDURE HITUNG;VAR I:INTEGER;BEGINJUMXY:=0; JUMY :=0;JUMX :=0; RATAX:=0;RATAXY:=0;FOR I:=1 TO N DOBEGINJUMXY:=JUMXY+X[I]*Y[I];JUMY:=JUMY+Y[I];JUMX:=JUMX+X[I];END;RATAX:=JUMX/N;FOR I:=I TO N DORATAXY:=RATAXY+SQR(RATAX-Y[I  P:=JUMY+JUMXY+RATAXY;END;PROCEDURE TAMPIL;BEGINCLRSCR;GOTOXY(3,8);WRITELN('OUTPUT PROGRAM');GOTOXY(3,10);WRITELN('BANYAK DATA MASING-MASING X DAN Y=',N);GOTOXY(3,12);WRITELN('JUMLAH DATA X=',JUMX:2:2);GOTOXY(3,14);WRITELN('JUMLAH DATA Y=',JUMY:2:2);GOTOXY(3,16);WRITELN('RATA-RATA DATA X=',RATAX:2:2);GOTOXY(3,18);WRITELN('HASIL=',P:2:2);END;{PROGRAM UTAMA}BEGINREPEATCLRSCR;BACA_DATA;HITUNG;TAMPIL;GOTOXY(3,20);gotoxy(17,22);WRITE('ENTER 2X UNTUK MELANJUTKAN......?????');READLN(LAGI);UNTIL UPCASE(LAGI)<>'Y';END.  PROGRAM MATRIKS;USES WINCRT;CONST BarisMAKS=15;(*cacah baris*)KolomMAKS=15;(*cacah kolom*)TypeTabel=array[1..barisMAKS, 1..KolomMAKS] of REAL;Var MatriksA,(*matriks pertama*)MatriksB,(*matriks kedua*)Mat_kali,(*hasil Kali*)Mat_Plus : Tabel;(*hasil jumlah*)BARIS1,KOLOM1,BARIS2,KOLOM2:integer;(*perubah bantu*)LAGI : CHAR;PROCEDURE BACA_DATA (VAR BARIS1,KOLOM1,BARIS2,KOLOM2:INTEGER);BEGINWRITE('JUMLAH BARIS MATRIKS A...?='); READLN(BARIS1);WRITE('JUMLAH KOLOM MATRIKS A...?='); READLN(KOLOM1);WRITE('JUMLAH BARIS MATRIKS B...?='); READLN(BARIS2);WRITE('JUMLAH KOLOM MATRIKS B...?='); READLN(KOLOM2);END;PROCEDURE BACA_ELEMEN(VAR MAT:TABEL; BARIS, KOLOM :INTEGER);VAR I, J:INTEGER;BEGINFOR I:=1 TO BARIS DOBEGINFOR J:= 1 TO KOLOM DOBEGINWRITE('ELEMEN KE:',I,'',J,'=');READ(MAT[I,JEND;END;END;(*PROCEDURE BACA MATRIKS*)PROCEDURE MATRIKS_KALI (VAR KALI:TABEL;MatA, MatB: TABEL);VAR I,J,K:INTEGER;BEGINIF KOLOM1=BARIS2 THENBEGINFOR I:= 1 TO BARIS1 DOFOR J:=1 TO KOLOM2 DOBEGINKALI[I,J]:=0;FOR K:=1 TO KOLOM1 DOKALI[I,J]:=KALI[I,J]+MatA[I,K]*MatB[K,J];ENDENDELSEBEGINWRITELN('KEDUA MATRIKS TIDAK DAPAT DIKALIKAN'); END;END; (*PROCEDURE MATRIKS KALI*)  PROCEDURE MATRIKS_PLUS(VAR PLUS:TABEL;MatA, MatB:TABEL);VAR I, J :INTEGER;BEGINIF (BARIS1=BARIS2) AND (KOLOM1=KOLOM2) THENBEGINFOR I:= 1 TO BARIS1 DOFOR J:=1 TO KOLOM1 DOPLUS[I,J]:=MatA[I,J]+MatB[I,J]ENDELSEWRITELN('MATRIKS TIDAK DAPAT DIJUMLAHKAN');END;PROCEDURE CETAK_MATRIKS (MATRIKS :TABEL; VAR BARIS, KOLOM:INTEGER);VAR I,J:INTEGER;BEGINFOR I:=1 TO BARIS DOBEGINFOR J:=1 TO KOLOM DOBEGINWRITE(MATRIKS[I,J]:8:2)END;WRITELN;END;END;{PROSEDUR CETAK_MATRIKS}PROCEDURE TAMPIL;BEGINCLRSCR;WRITELN('HASIL PERHITUNGAN');WRITELN('-------------------------------'); WRITELN;IF KOLOM1=BARIS2 THENBEGINWRITELN('MATRIKS A KALI MATRIKS B'); WRITELN;CETAK_MATRIKS(Mat_KALI,BARIS1,KOLOM2);WRITELN;END;IF (BARIS1=BARIS2)AND(KOLOM1=KOLOM2)THENBEGINWRITELN; WRITELN('MATRIKS A TAMBAH MATRIKS B'); WRITELN;CETAK_MATRIKS(MAT_PLUS,BARIS1,KOLOM1);END;WRITELN; WRITELN; WRITELN('SELESAI');END;{PROGRAM UTAMA}
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x