1 / 7

LATIHAN

LATIHAN. Instruksi. Buatlah instruksi untuk mencetak huruf DDP secara vertikal !. Prosedur. Definisikan prosedur untuk mencetak huruf DDP secara vertikal. Prosedur Berparameter.

kathy
Download Presentation

LATIHAN

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LATIHAN

  2. Instruksi • Buatlah instruksi untuk mencetak huruf DDP secara vertikal!

  3. Prosedur • Definisikan prosedur untuk mencetak huruf DDP secara vertikal

  4. Prosedur Berparameter • Definisikanprosedur x, y, dan z sehinggaurutaninstruksi NL; r3(x); NL; r3(y);NL; r3(z) mencetakpoladibawahini * * * **** ** *** *** *** • Definisikanprosedur r4 sehinggabiladiberikandefinisi x, y, dan z darisoal 1, urutaninstruksi NL; r4(x); NL; r4(y);NL; r4(z) akanmencetakpola * * * * ** ** ** ** *** *** *** *** • Kalau r3(one) seperti yang didefinisikandiatasyaitumencetaksatu *. Biladiberikandefinisi def A() = r3(one); r3(one); r3(one); enddef Berapa * yang dicetak?

  5. Prosedur Berparameter Banyak • Cari arti dari program di bawah ini dengan menulis urutan kerjanya: def sandwich(selei,roti,keju)=roti();selei();keju();roti() enddef def pO() = pc(‘O’) enddef def pX() = pc(‘X’) enddef def pZ() = pc(‘Z’) enddef def big() = pO(); pX(); pZ(); enddef sandwich(pX,pO,pZ) sandwich(pO,pZ,pX) sandwich(pX,pO,big)

  6. Definisi Dalam Definisi Tentukan output dari program di bawah ini dengan menulis urutan kerjanya: def pat(c) = def r3(p)=p();p();p() enddef def x()=printchar(c) enddef NL;r3(x) enddef pat(‘*’)

  7. Rajin-rajinlah berlatih, usaha dan kerja keras anda sangat dihargai..GBU 

More Related