Menu (Prolog)

|

menu:-nl,
write('MENU'),nl,
write('1.Biodata'),nl,
write('2.Luas Segitiga'),nl,
write('3.Exit'),nl,
write('Pilihan Anda'),read(Pil),nl,
(Pil=1 -> nl,
write('nama='),read(Nama),nl,
write('npm='),read(Npm),nl,
write('kelas='),read(Kelas),nl,
write('nama saya='),write(Nama),nl,
write('npm saya='),write(Npm),nl,
write('kelas saya='),write(Kelas),nl,
menu;
Pil=2 -> nl,
write('masukkan alas='),read(Alas),nl,
write('masukkan tinggi='),read(Tinggi),nl,
Luas is Alas*Tinggi*0.5,
write('luas='),write(Luas),
menu;
Pil=3 -> nl,
write('Exit !!!'),nl).

0 komentar:

Posting Komentar