Kapalı

Write a Program in the Scheme Programming Language

Write a Scheme program that implements the following functions:

• (convert number base) The function should convert the number in base 10 to its equivalent in base base

• This procedure, called roll-till-you-win, takes as argument a particular bet and simulates the rolling of a die until the bet wins

(define (roll-till-you-win bet)

(let ((die-roll (1+ (random 6))))

(display die-roll)

(newline)

(cond ((=die-roll bet) (display “You won!”))

(else (roll-till-you-win bet)))))

Modify roll-till-you-win so that the procedure makes a random bet at each roll. The new procedure should take no arguments and simply keep rolling the die until the random bet happens to be the same as the new roll. Here is a sample printout of the result:

Bet: 5 Result: 4

Bet: 1 Result: 3

Bet: 4 Result: 4

You won!

• Write a third procedure: (list-primes n) This procedure will print the prime numbers up to n. Sample:

(list-primes 20)

2

3

5

7

11

13

17

19

Beceriler: Scheme

Daha fazlasını gör: scheme compiler, scheme language tutorial, how to code in scheme, scheme tutorial pdf, scheme language examples, scheme functions, scheme download, learn scheme, the scheme programming language, how to write your own programming language, scheme programming language, mips program print prime numbers, write assembly language program performing addition 8bit numders , solution write test mips assembly language program count letters text file, solution counting words text file finding frequency write test mips assembly language program

İşveren Hakkında:
( 1 değerlendirme ) Seattle, United States

Proje NO: #15728612

Bu iş için 2 freelancer ortalamada $50 teklif veriyor

ahmsak

Hello Sir, I've already started working on your project to deliver in time. I am a computer science tutor, I teach (among others) Scheme, LISP, Haskell, Prolog and Algorithms. I have done many projects like this, an Daha Fazla

in %bids___i_period_sub_35% gün içinde55%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(22 Değerlendirme)
5.1
Domus123

Hi, I have worked a lot with scheme and functional languages. I can do this to you in a couple hours. Thank you Habilidades e Experiência Relevantes I have implemented a lot of algorithms in Lisp/Scheme. Pré-p Daha Fazla

in %bids___i_period_sub_35% gün içinde45%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(3 Değerlendirme)
3.0