Lompat ke konten Lompat ke sidebar Lompat ke footer

Contoh Program Graph Struktur Data

program menampilkan_grafik;
uses crt;
type tahun=array[1..6] of byte;

procedure input(var thn:tahun);
var i:byte;

begin
clrscr;
gotoxy(5,1);write('Data Jutaan');
for i:=1 to 6 do

begin
repeat
gotoxy(5,2+i);write('tahun',i,':');
gotoxy(17,2+i);clreol;
gotoxy(17,2+i);readln(thn[i]);
until (thn[i]>0) and (thn[i]<16);
end;
end;
procedure gambar(thn:tahun);
var i,j:byte;

begin
for i:=0 to 14 do
begin
gotoxy(35,2+i);write(15-i:2,'|');
end;
gotoxy(36,17);write(0,' ');
for i:=1 to 35 do write('-');
gotoxy(39,18);write('2011  2012 2013  2014  2015  2016');
gotoxy(41,21);write('Jumlah penduduk Bandung');
for i:=1 to 6 do
for j:=1 to thn[i] do

begin
gotoxy(33+i*6,17-j);write('###');
end;
readkey;
end;
var data:tahun;

begin
input(data);
gambar(data);
end.



Buat Graph Online:
  1. https://graphonline.ru/en/
  2. https://live.yworks.com/demos/analysis/graphanalysis/index.html
  3. https://visualgo.net/en