Question: Use OCaml to write a program that returns one of four string values for each street number: N / A when the street
Use OCaml to write a program that returns one of four string values for each street
number:
NA when the street doesn't exist. We only consider st
through th Streets.
N when the street goes north.
S when the street goes south.
NS when the street is twoway.
Hints:
You may find the infix 'mod' modulo function useful: for example,
mod evaluates to if is even and otherwise.
Sometimes there is no simpleclever way of writing down a
complex case analysis: you just have to write out all the cases.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
