1 / 6

Praktikum 2 Bahasa Pemrograman PLT Scheme : Membuat Program

Praktikum 2 Bahasa Pemrograman PLT Scheme : Membuat Program. Sabtu , 19 Maret 2011 Tim Asisten Praktikum Basprog. Latihan 1. Diberikan tiga bilangan bulat . Program akan memeriksa apakah bilangan yang di tengah merupakan hasil kali bilangan di kiri dan kanannya .

javier
Download Presentation

Praktikum 2 Bahasa Pemrograman PLT Scheme : Membuat Program

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. Praktikum 2BahasaPemrogramanPLT Scheme : Membuat Program Sabtu, 19 Maret 2011 Tim AsistenPraktikumBasprog

  2. Latihan 1 Diberikantigabilanganbulat. Program akanmemeriksaapakahbilanganyang di tengahmerupakanhasil kali bilangandi kiridankanannya. > (cek 2 5 9) #f > (cek 3 15 5) #t

  3. Latihan 2 Perhatikan definisi fungsi Ackermann berikut: • Ack(0,y) = y + 1 • Ack(x,0) = Ack(x-1,1), x > 0 • Ack(x,y) = Ack(x-1,Ack(x,y-1)), x,y> 0 Dengandemikian, sebagaicontoh, nilaiAck(2,3) = 9, dan Ack(3,2)=29. Buatprogramuntukmenghitungfungsi Ackermanndariduabilanganbulat. Contoh: > (ack 2 3 ) 9 > (ack 3 2) 29

  4. Latihan 3 Menghitungbanyaknyabilanganbulat padaselang [a, b] yang habisdibagioleh n. Contoh: > (hitung 3 20 4) ; Menghitungbanyaknya 5 ; bilanganantara3 s/d 20 yg ; habisdibagi 4 Ada5 : ;4, 8, 12, 16, 20

  5. Latihan 4 Menghitungbanyaknyafaktorbilangan bulatselain 1 danbilanganitusendiri. Contoh: > (faktor 15) 2 ; Adaduafaktor, yaitu 3 dan 5 ; Bilangan yang habismembagibilangan ; tersebut

More Related