CONTOH CASE OF 1
uses wincrt;
Var
Angka :char;
Begin
Write('Masukkan Angka Jurusan (1/2/3/4) : ');Readln(Angka);
Case Angka Of
'1':writeln('TM/D3');
'2':writeln('TE/S1');
'3':writeln('SI/S1');
'4':writeln('TI/S1');
Else
Begin
writeln ('Tidak Ada Jurusan Tersebut di Universitas Muria Kudus');
End
end;
End.
CONTOH CASE OF 2
program UKURAN_JAKET;
uses wincrt;
Var
Ukuran : Char ;
Banyak : Real ;
Harga, Jumlah : Real ;
Begin
Write('Ukuran Jaket (S?M?L) : '); Read(Ukuran) ;
Write('Banyak Jaket : '); Read(Banyak);
Case upcase(Ukuran) Of
'S' : Harga := 1000 ;
'M': Harga := 1250 ;
'L' : Harga := 15000 ;
Else
writeln ('Ukuran Jaket anda tidak ada...sorry');
end;
End.
Komentar