Sabtu, 05 Juni 2010

Contoh Program Pascal

Identification Division.
Program-Id Program1.
Environment Division.
Data Division.
Working-Storage Section.
01 Data-Mhs.
02 Nama pic a(20).
02 Jurusan pic a(15).
02 NPM PIC 9(10).
02 Kelas pic x(5).
Screen Section.
01 Hapus-Layar.
02 Blank Screen.
01 Masukkan.
02 Line 2 column 3 value 'Bagian Input'.
02 Line 4 column 5 value 'Nama Mahasiswa :'.
02 Column plus 2 pic a(20) to nama.
02 Line 6 column 5 value 'jurusan :'.
02 Column plus 2 pic a(15) to jurusan.
02 Line 8 column 5 value 'Kelas :'.
02 Column plus 2 pic x(5) to kelas.
02 Line 10 column 5 value 'NPM :'.
02 Column plus 2 pic 9(10) to NPM.
01 Keluaran.
02 Line 12 column 3 value 'Bagian output '.
02 Line 14 column 5 value 'Nama saya :'.
02 Column plus 2 pic a(20) from nama.
02 Line 16 column 5 value 'Jurusan saya :'.
02 Column plus 2 pic a(15) from jurusan.
02 Line 18 column 5 value 'Kelas saya :'.
02 Column plus 2 pic x(10) from kelas.
02 Line 20 column 5 value 'NPM saya :'.
02 Column plus 2 pic 9(10) from NPM.
Procedure Division.
Mulai.
Display Hapus-Layar.
Display Masukkan.
Accept Masukkan.
Display Keluaran.
Stop Run.

0 comments:

Posting Komentar