0
Program Pascal Pendaftaran Mahasiswa Baru
Posted by Unknown
on
23.03
program pendaftaran mahasiswa dengan menggunakan program pascal .......
program m_baru;
uses wincrt;
var
nm,as,t:string;
d,m,y:integer;
no:integer;
tot,bp,ug:longint;
begin
write (' nomor : '); readln (no);
write (' nama : '); readln (nm);
write (' Tempat Lahir : '); readln(t);
write (' tanggal lahir : '); readln (d,m,y);
case m of
1,3,5,7,8,10,12:begin
if (d>31) then
begin
writeln('Tanggal salah');
readkey;
donewincrt;
end;
end;
4,6,9,11:begin
if (d>30) then
begin
writeln('Tanggal salah');
readkey;
donewincrt;
end;
end;
2:begin
if (y mod 4=0) then
begin
if (d>29) then
begin
writeln('Tanggal salah');
readkey;
donewincrt;
end
else
begin
if (d>28) then
writeln('Tanggal salah')
end;
end;
END;
end;
if ( m > 12) then
begin
writeln(' Bulan salah!');
readkey;
donewincrt;
end
else if (y >= 1995) then
begin
writeln('Tahun salah!');
readkey;
donewincrt;
end;
write ('asal sekolah : ');readln (as);
write ('biaya pendaftaran : ');readln (bp);
write ('uang gedung : ');readln (ug);
writeln;
tot:=(bp+ug);
writeln ('total : ',tot)
end.
SCREENSHOT.....
program m_baru;
uses wincrt;
var
nm,as,t:string;
d,m,y:integer;
no:integer;
tot,bp,ug:longint;
begin
write (' nomor : '); readln (no);
write (' nama : '); readln (nm);
write (' Tempat Lahir : '); readln(t);
write (' tanggal lahir : '); readln (d,m,y);
case m of
1,3,5,7,8,10,12:begin
if (d>31) then
begin
writeln('Tanggal salah');
readkey;
donewincrt;
end;
end;
4,6,9,11:begin
if (d>30) then
begin
writeln('Tanggal salah');
readkey;
donewincrt;
end;
end;
2:begin
if (y mod 4=0) then
begin
if (d>29) then
begin
writeln('Tanggal salah');
readkey;
donewincrt;
end
else
begin
if (d>28) then
writeln('Tanggal salah')
end;
end;
END;
end;
if ( m > 12) then
begin
writeln(' Bulan salah!');
readkey;
donewincrt;
end
else if (y >= 1995) then
begin
writeln('Tahun salah!');
readkey;
donewincrt;
end;
write ('asal sekolah : ');readln (as);
write ('biaya pendaftaran : ');readln (bp);
write ('uang gedung : ');readln (ug);
writeln;
tot:=(bp+ug);
writeln ('total : ',tot)
end.
SCREENSHOT.....