Question: Racket - Scheme 'ludicrous' - the input to this function is a single integer. The output is a boolean (either true #t or false #f),

Racket - Scheme

'ludicrous' - the input to this function is a single integer. The output is a boolean (either true #t or false #f), indicating whether or not the input number is "ludicrous". A number is deemed to be "ludicrous" if every one of its digits is even, or if every one of its digits is odd. For example, (ludicrous 8126) would return #f, because one digit is odd while the others are even. As another example, (ludicrous 315) would return #t, because every digit is odd. Similarly, (ludicrous 860) would return #t (true), because every digit is even. You'll probably need to use the modulo function, and you'll probably also need integer division, which can be found in Racket's help facility.

(define (ludicrous x))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!