Program Julia; uses Graph, wincrt; var GraphDriver, GraphMode, ErrorCode:integer; x, y, x0, y0, x1, y1, z, m, n, c1, c2: real; S, T, U, V: string; i, j:integer; screenXmax, screenYmax, theight, twidth: integer; xmax, ymax, xmin, ymin:real; function scalex (realx: real) :integer; begin scalex:= reound((realx-xmin) / (xmax = xmin) * screenXmax); end; function scaley(realy: real) :integer; begin scaley := screenYmax - round((realy-ymin) / (ymax-ymin) * (screenYmax - (3*theight) +1))); end; procedure plotline(x1, y1, x2, y2 :real); begin moveto(scalex(x1), scaley(y1)); lineto(scalex(x2), scaley(y2)); end; procedure gwriteline(n:integer; S:string); var yline: integer; begin yline := n*theight; SetColor(Black); while(yline <= (n+1) * theight) do begin moveto(0,yline); lineto(screenXmax, yline); yline :=yline +1; end; SetColor(LightCyan); OutTextXY(50, n*theight,S); end; begin writeln('Input the constants.'); readln(c1); readln(c2); GraphDriver := Detect; InitGraph(GraphDriver, GraphMode, 'BGI'); ErrorCode := GraphResult; if ErrorCode <> gr0k then begin writeln('Graphics error: ', GraphErrorMsg(ErrorCode)); writeln('Program Aborted ....'); readln; Halt(1); end; screenXmax := GetMaxX; screenYmax :=GetMaxY; xmax := 200 ; xmin := 0; ymax := 200; ymin := 0; SetTextStyle(DefaultFont, HorizDir, 1); theight := TextHeight('igyITQq'); twidth := TextWidth('W'); str(c1:10:7, S); str(c2:10:7, T); gwriteln(0, 'c = ' + S + ' + ' + T + 'i'); m := 0; while (m <= 200) do begin x0 := -2 + (m/50); n := 0; while (n <= 100) do begin y0 := 2 - (n/50); x := x0; y := y0; i := 1; z := 0; while (i <= 20) and (z <= 4) do begin x1 := (x*x) - (y*y) + c1; y1 := (2*x*y) + c2; x := x1; y := y1; z := (x*x) + (y*y); i := i + 1 ; end; if (z <= 4) then begin PutPixel(scalex(m), scaley(n), 15-trunc(z*4)); PutPixel(scalex(200-m), scaley(200-n), 15-trunc(z*4)); end; n := n+1; end; m := m + 1; end; gwriteln(2, 'END'); readln; CloseGraph; end.