Find Jobs
Hire Freelancers

Scheme Functions 4.0

$30-5000 USD

Tamamlandı
İlan edilme: neredeyse 20 yıl önce

$30-5000 USD

Teslimde ödenir
##### Part I, Polynomials A data abstraction for polynomials was discussed in class. Create the file *[login to view URL]* and implement the following: 1. Constant **zp**. The zero polynomial. 2. Procedure **degree**. (degree p) ; returns the degree of polynomial *p* 3. Procedure **lc**. (lc p) ; returns the leading coefficient for polynomial *p* 4. Procedure **prest**. (reset p) ; returns the rest of polynomial *p* except leading term. 5. Constructor **pcons**. (pcons n a p) ; returns polynomial created from *a*xn and polynomial *p* Note! The underlying implementation must use a list of 2-element vectors to represent the polynomial. Zero terms should not be included. 6. Procedure **mt**. (mt d c) ; returns term created as *c*xd 7. Procedure **lt**. (lt p) ; returns the leading term from polynomial *p*. 8. Procedure **p+**. (p+ p1 p2) ; returns the sum of polynomials *p1* and *p2*. 9. Procedure **p***. (p* p1 p2) ; returns the product of polynomials *p1* and *p2*. 10. Procedure **np**. (np p) ; returns the negation for polynomial *p*. 11. Procedure **p-**. (p- p1 p2) ; returns the difference of polynomials *p1* and *p2*. 12. Procedure **v**. (v p n) ; returns the value of polynomial *p* when *x* is equal to *n*. ## Deliverables Part II, Binary Numbers. Implement the binary number functions discussed in class. Create the file *[login to view URL]* for the following: 1. Procedure **d->p** Parameter: list of binary digits Return: polynomial of degree 1 less than number of digits with digits as coefficients 2. Procedure **binary->decimal** Parameter: list of digits representing a binary number Return: decimal value 3. Procedure **p->d** Parameter: decimal number Return: list of digits in binary representation 4. Procedure **decimal->binary** Parameter: decimal value Return: list of digits representing the binary equivalent Part III, Number Conversion Implement the number conversion functions listed below. Create the file *[login to view URL]* for the following: Look over the programs for **b->d** and **d->b** and determine what changes have to be made to get definitions for the four procedurs: octal->decimal hexadecimal->decimal decimal->octal decimal->hexadecimal Since we are representing our hexadecimal numbers as lists of digits, we can use the number 10 for *A*, 11 for *B*, and so on, so that (12 5 10) is the list representation of the hexadecimal number *C5A*. Define one pair of conversion procedures **base->decimal** and **decimal->base** that takes two arguments, the number to be converted and the base, where the base can be any positive integer Then define a procedure **change-base** that changes a number *num* from base *b1* to base *b2*, where *num* is a list of digits. Thus *(change-base num b1 b2)* is a list of digits that gives the base *b2* representation of *num*. The following are some examples: (change-base '(5 11) 16 8) => (1 3 3) (change-base '(6 6 2) 8 2) => (1 1 0 1 1 0 0 1 0) (change-base '(1 0 1 1 1 1 1 0 1) 2 16) => (1 7 13) ## Platform Write Scheme source code for the above functions. The requried interpreter is SISC Version 1.8.7 which can be downloaded free from [login to view URL] Below are a few restrictions that have to be kept in mind when writing code. 1) Each of the functions must be specified using the full *lambda expression* to emphasize that they are first class entities in the language. 2)If you decide to use *define* anywhere in your code it is to be used for values bound at the top-level only. Local functions should be declared using *let* or one of its variants. The attached zip file has the specifications and requirements for the project in case anything is hard to read. **THE DUE DATE FOR THIS IS MONDAY MAY 3RD 04**. **_HE DUE DATE FOR THIS IS MONDAY MAY 3RD 04_**.
Proje No: 3188942

Proje hakkında

2 teklif
Uzaktan proje
Son aktiviteden bu yana geçen zaman 20 yıl önce

Biraz para mı kazanmak istiyorsunuz?

Freelancer'da teklif vermenin faydaları

Bütçenizi ve zaman çerçevenizi belirleyin
Çalışmanız için ödeme alın
Teklifinizin ana hatlarını belirleyin
Kaydolmak ve işlere teklif vermek ücretsizdir
Seçilen:
Kullanıcı Avatarı
See private message.
$21,25 USD 7 gün içinde
5,0 (17 değerlendirme)
4,1
4,1
2 freelancers are bidding on average $53 USD for this job
Kullanıcı Avatarı
See private message.
$85 USD 7 gün içinde
5,0 (11 değerlendirme)
4,1
4,1

Müşteri hakkında

   UNITED STATES bayrağı
United States
4,8
27
Eki 17, 2003 tarihinden bu yana üye

Müşteri Doğrulaması

Teşekkürler! Ücretsiz kredinizi talep etmeniz için size bir bağlantı gönderdik.
E-postanız gönderilirken bir şeyler yanlış gitti. Lütfen tekrar deneyin.
Kayıtlı Kullanıcı İlan Edlien Toplam İş
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ön izleme yükleniyor
Coğrafik konum için izin verildi.
Giriş oturumunuzun süresi doldu ve çıkış yaptınız. Lütfen tekrar giriş yapın.