Question: Write the following Scheme function in the program DrRacket: make5 - this takes two integers, and returns a 5-digit integer constructed of the rightmost 3

Write the following Scheme function in the program DrRacket:

make5 - this takes two integers, and returns a 5-digit integer constructed of the rightmost 3 digits of the first input, and the leftmost 2 digits of the second input.

For example, (make5 561432 254) would return 43225.

Negative signs on either input number should be ignored - that is, (make5 561432 -254) would also return 43225.

If the first number has less than three digits or the last three digits start with zeros, and/or the second number has less two digits, your function should return -2.

Note: you may want to define some auxiliary functions.

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!