Pages

Senin, 13 Juli 2015

Pembuatan Grafik Pada Turbo Pascal



Program Studi : S1-Teknik Informatika Konsep Pemrograman

Uses crt;
Var
o,p,q,r                            : byte;
i,j,k,l,m,nilai,Total                   : integer;  
jumlah                            : array[1..3] of integer;  
jawab                             : char; Label 1;
begin
{awal program kEndali ulang}
1: Clrscr;
{Membuat Kotak Tempat Grafik}
Textcolor(Red);
For o:=1 to 20 do
begin
Gotoxy(33,2+o);Write('|');
End;

For p:=1 to 40 do
 begin
Gotoxy(33+p,2);Write('_');
End;

For q:=1 to 20 do
begin
Gotoxy(74,2+q);Write('|');
End;

For r:=1 to 40 do
begin
Gotoxy(33+r,22);Writeln('_');
End;

Textcolor(White);

{Membuat Grafik X dan Y}

For m:=1 to 20 do
begin
Gotoxy(53,23-m);Writeln('|');
 End;
Gotoxy(35,12);Writeln('--------------------------------------'); Gotoxy(1,1);Writeln('DAFTAR PENJUALAN BARANG'); Gotoxy(1,2);Writeln('PT. ABC MEDAN SUDUT');

 
Gotoxy(1,3);Writeln('==============================='); Gotoxy(1,5);Write('Hasil NPM : ');Readln(Nilai);

{Menguji NPM nilai 1 sampai 3}

If (nilai>=1) and (nilai<=3) then
begin
For i:=1 to 3 do
begin
Gotoxy(1,6);Write('Masukkan Jumlah Barang (bulan)'); Gotoxy(1,6+i);Write('Bulan [1] : ');Readln(jumlah[i]);

For k:=1 to jumlah[i] do
begin
Textcolor(Green);
Gotoxy(54+3*i,12-k);Writeln('==');
Gotoxy(54+3*i,13);writeln(i);
Textcolor(White);
End;
End;
End;

{Menguji NPM nilai 4 sampai 7}

If (nilai>=4) and (nilai<=7) then
begin For i:=1 to 3 do
begin
Gotoxy(1,6);Write('Masukkan Jumlah Barang (bulan)'); Gotoxy(1,6+i);Write('Bulan [1]: ');Readln(jumlah[i]);

For k:=1 to jumlah[i] do
begin
Textcolor(Blue);
Gotoxy(54+3*i,12+k);Writeln('==');
Gotoxy(54+3*i,11);writeln(i);
Textcolor(white);
End;
End;
End;

{Menguji NPM nilai 8 sampai 10}

If (nilai>=8) and (nilai<=10) then
begin
For i:=1 to 3 do
begin
Gotoxy(1,6);Write('Masukkan Jumlah Barang (bulan)'); Gotoxy(1,6+i);Write('Bulan [1]: ');Readln(jumlah[i]);

For k:=1 to jumlah[i] do
begin
Textcolor(Yellow);
Gotoxy(51-k,12-2*i);Writeln('|');
Gotoxy(54,12-2*i);writeln(i);
Textcolor(White);
End;
End;
End;

{Menghitung Total Jumlah Barang}

Total:=0;
For i:=1 to 3 do
Begin
Total:=Total+Jumlah[i]; End; Gotoxy(1,10);Write('==========================='); Gotoxy(1,11);Write('Total Barang : ', total);

{Permintaan Ulang Program}

Gotoxy(1,13);Write('Ulang Lagi ? [Y/T] : ');Readln(jawab);
If (jawab= 'Y') or (jawab ='y') then Goto 1 ;
Readln;
End.

0 komentar:

Posting Komentar